none
Remove Appx Package for other local user with PowerShell RRS feed

  • Question

  • Hi everyone,

    I'm trying to make my script working. The script is running locally on a Windows 10 PC as local Administrator. The computer doesn't belong to any Active Directory.

    The local User A has installed the application Microsoft.MicrosoftSolitaireCollection. Not the local Administrator. I want to remove it for the local User A.

    Get-AppxPackage -User "User A" -Name Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage

    The previous command doesn't work and the error says that the package cannot be found. 

    Tuesday, December 20, 2016 11:28 PM

All replies

  • Did you try this?

    Get-AppxPackage -allusers PackageFullName | Remove-AppxPackage

    Completely Uninstall Pre-Installed Windows Store Apps in Windows 10


    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    Wednesday, December 21, 2016 12:06 AM
  • Thank you for your answer.

    Yes I have tried. Since the Get-AppxPackage -AllUsers Microsoft.MicrosoftSolitaireCollection_3.12.12120.0_x64__8wekyb3d8bbwe command doesn't return anything, the package removal doesn't return any error but doesn't remove anything!

    Wednesday, December 21, 2016 8:52 AM
  • And the 
    Get-AppXProvisionedPackage -online | Remove-AppxProvisionedPackage -online
    mentioned on the site I posted the link does not work either?

    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    Wednesday, December 21, 2016 10:18 AM
  •  get-appxpackage *solitaire* | remove-appxpackage

    this will remove for current user

    get-appxpackage -allusers *solitaire*  | remove-appxpackage

    for all users

    get-appxpackage –User domain\username *solitaire*  | remove-appxpackage

    to test drop the | remove-appxpackage from these commands and you should see solitare listed as a app. Make sure you run commands at a elevated powershell prompt, open command prompt (admin) and then powershell.

    Wednesday, December 21, 2016 12:47 PM
  • Hi,

    Darren Blanchard's answer is exact.

    Here is the exact command I have tried:

    Get-AppxPackage -User \UserA | Where-Object {$_.Name -match ".*Solitaire.*"} | Remove-AppxPackage

     

    This command works from the UserA context BUT not from the local Administrator context.

    In fact the first part works and return the App, but the Remove-AppxPackage fails

    Sunday, January 1, 2017 5:51 PM
  •  get-appxpackage *solitaire* | remove-appxpackage

    this will remove for current user

    get-appxpackage -allusers *solitaire*  | remove-appxpackage

    for all users

    get-appxpackage –User domain\username *solitaire*  | remove-appxpackage

    to test drop the | remove-appxpackage from these commands and you should see solitare listed as a app. Make sure you run commands at a elevated powershell prompt, open command prompt (admin) and then powershell.

    This is incorrect.  All these commands do is remove the package for the current user.  In all three cases.  

    • Edited by JS2010 Thursday, June 20, 2019 2:52 AM
    Thursday, June 20, 2019 2:52 AM
  • This works fine for me:

    get-appxpackage *zune* | remove-appxpackage -AllUsers

    See: https://www.askvg.com/guide-how-to-remove-all-built-in-apps-in-windows-10/


    \_(ツ)_/

    Thursday, June 20, 2019 2:59 AM
  • What version are you in?  In 1709 I get (Microsoft.ZuneVideo & Microsoft.ZuneMusic)

    PS C:\Users\jsz> get-appxpackage *zune* | remove-appxpackage -AllUsers
    remove-appxpackage : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
    At line:1 char:26
    + get-appxpackage *zune* | remove-appxpackage -AllUsers
    +                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Remove-AppxPackage], FileNotFoundException
        + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Windows.Appx.PackageManager.Commands.RemoveApp
       xPackageCommand

    • Edited by JS2010 Thursday, June 20, 2019 3:06 AM
    Thursday, June 20, 2019 3:03 AM
  • 1709 is no longer a version.  We are at 1809.  The error says the package doesn't.  Are you on W10 enterprise.  Zune is not installed on enterprise.

    Also GP can now remove packages and custom deployments can eliminate many consumer level packages.


    \_(ツ)_/

    Thursday, June 20, 2019 3:09 AM
  • 1709 enterprise had those 2 zune packages.  Same results in 1803 with *calc*.  "remove-appxpackage -user sid" (and it can only be the sid) doesn't error, but it doesn't work anyway.

    • Edited by JS2010 Thursday, June 20, 2019 3:31 AM
    Thursday, June 20, 2019 3:30 AM
  • I've confirmed this works in windows 10 1809 only.  You just need get-appxpackage to get the PackageFullName.

    get-appxpackage *pattern* | remove-appxpackage -AllUsers

    Thursday, June 20, 2019 2:49 PM