Unable to uninstall an application using PowerShell/InTune - McAfee

Alim Bhaluani 1 Reputation point
2021-11-03T02:21:23.707+00:00

Hello Everyone, I need some help...

I've been trying to uninstall McAfee Personal Security (MS Store App) using PowerShell/InTune but I'm having some issue.

The script is fairly simple, it's a one line command.

*Get-appxpackage -allusers 5A894077.McAfeeSecurity | Remove-AppPackage*

This works when running the script on the machine via PowerShell.

The issue seems to be when running the script through any automation process such as InTune or Task Scheduler (tested in both).

I've used Verbose and created a log file txt output to show it's running correctly. I've also created transcripts of the script which show successful as well.
I've also checked the IntuneManagementExtension log files & confirmed it ran successfully.
I've tried setting the execution policy to Unrestricted as well.

The deployment is applys to an AD Azure Group with 1 device (for testing) and is set to run as system (run as logged in user box is unchecked).

Please let me know your thoughts and if you need any further details or logs.

  • Alim
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Intune | Configuration
Microsoft Security | Intune | Application management
Microsoft Security | Intune | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Lu Dai-MSFT 28,516 Reputation points
    2021-11-03T05:48:18.937+00:00

    @Alim Bhaluani Thanks for posting in our Q&A.

    To clarify this issue, we appreciate your help to collect some information:

    1. Please make sure the Powershell script is deployed to the device successfully.
    2. Please check if the device is 64 bit. If yes, please set "Run script in 64 bit PowerShell Host" to "Yes" in the Powershell script.
    3. Make sure the device is Azure AD joined, not Azure AD registered.
    4. From your description, did you mean that the setting "Run this script using the logged on credentials" is set to "No"?
      If yes, is it successful when you use the local system account to run the Powershell script?

    If there is anything update or any misunderstanding, feel free to let us know.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Rahul Jindal 11,511 Reputation points
    2021-11-03T07:53:59.347+00:00

    If it is a store app, then you should be able to sync it from store for business to Intune and create an uninstallation assignment.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.