Forum Discussion
-AllUsers won't work as an admin (Get-AppxPackage or Remove-AppxPackage)
Hi paobmmc,
The error you encountered is (in my opinion) because the "Remove-AppxPackage" command does not have a parameter called "PackageName." To remove the Microsoft Solitaire Collection app package from all user accounts on your computer, you could try use a different workaround.
Get-AppxPackage -AllUsers *MicrosoftSolitaireCollection* | Remove-AppxPackage
This command will find the Microsoft Solitaire Collection app package for all users on the computer and then it should remove it.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
- paobmmcJul 26, 2023Copper ContributorHi, thank you for the reply
Although it didn't work, I'm still getting the same error.
PS C:\Users\xyz> Get-AppxPackage -AllUsers *MicrosoftSolitaireCollection* | Remove-AppxPackage
Get-AppxPackage : Access is denied.
Access is denied.
It works fine without -AllUsers though.
PS C:\Users\xyz> Get-AppxPackage *MicrosoftSolitaireCollection* | Remove-AppxPackage
PS C:\Users\xyz>- LeonPavesicJul 26, 2023Silver Contributor
Hi paobmmc,
thanks for the update.
Hmmm, the "Access is denied" error typically occurs when you try to remove the app package for all users without the necessary administrative privileges. When using the "-AllUsers" parameter with the "Get-AppxPackage" cmdlet, it requires elevated privileges. Are you sure you are doing that?
The last idea I have is to:2. Run the Command with Elevated Privileges in PowerShell:
Get-AppxPackage -AllUsers *MicrosoftSolitaireCollection* | Remove-AppxPackageIf you continue to encounter issues, you can maybe try this:
Get-AppxProvisionedPackage -Online | where DisplayName -eq "Microsoft Solitaire Collection" | Remove-AppxProvisionedPackage -OnlineHope it helps!
Kindest regards
Leon