Category filter
Scripts to uninstall Windows Store apps
Windows 10 comes with a set of pre-installed apps. However, not all apps might be useful in an organization. Using Hexnode, the administrators can deploy scripts to uninstall Windows Store apps.
Batch script
1 |
msiexec /x "path_to_msi “ /qn |
E.g., To remove the app Notepad saved in C drive,
msiexec /x "C:\TEMP\XmlNotepad.msi" /qn
PowerShell script
Uninstall a single store app for a specific user account
1 |
Remove-AppxPackage -Package "Package Name of the App" -User "SID of the user account" |
The Remove-AppxPackage
cmdlet is used to uninstall a Store app for a specific user account.
It uses two parameters: –Package
for specifying the package name of the Store app and –User
to specify the Security Identifier (SID) of the user account from which you want to remove the app.
E.g., To remove the system app Movies & TV for a user account with SID S-1-5-21-1146782021-2548981477-1140719770-1012 on the Windows device,
Remove-AppxPackage -Package "Microsoft.ZuneVideo_2019.22091.10041.0_neutral_~_8wekyb3d8bbwe" -User "S-1-5-21-1146782021-2548981477-1140719770-1012"
Uninstall a single store app for all user accounts
1 |
Get-AppxPackage *name of the app* -AllUsers | Remove-AppxPackage -AllUsers |
E.g., To remove the system app Alarms & Clock for all the user accounts on the Windows device,
Get-AppxPackage *Microsoft.WindowsAlarms* -AllUsers | Remove-AppxPackage –AllUsers
Uninstall store apps in bulk for a specific user account
1 2 3 4 5 6 |
$packagenames = @('Package name of store app 1','Package name of store app 2') foreach ($packagename in $packagenames) { Remove-AppxPackage -Package $packagename -User "SID of the user account" } |
Under $packagenames
, specify the package names of the Store apps that need to be removed as comma-separated entries, each enclosed in single quotes. Also, mention the Security Identifier (SID) of the user account under –User
.
E.g., To remove the Clock app and Mixed Reality Portal app together,
$packagenames = @('Microsoft.WindowsAlarms_2022.2304.0.0_neutral_~_8wekyb3d8bbwe','Microsoft.MixedReality.Portal_2000.21051.1282.0_neutral_~_8wekyb3d8bbwe')
foreach ($packagename in $packagenames)
{
Remove-AppxPackage -Package $packagename -User "S-1-5-21-1146782021-2548981477-1140719770-1011"
}
Uninstall store apps in bulk for all user accounts
1 2 3 4 5 6 |
$appnames = @(‘Name of store app 1’,'Name of store app 2') foreach ($appname in $appnames) { Get-AppxPackage -AllUsers | where-object {$_.name -match $appname} | Remove-AppPackage -AllUsers } |
You can either enter the full package name or the app name of the Store application in the space specified. Once the script is executed, the specified Store apps are removed for all users of the endpoint.
E.g., To remove the Camera app and News app together,
$appnames = @('Microsoft.WindowsCamera','news')
foreach ($appname in $appnames)
{
Get-AppxPackage -AllUsers | where-object {$_.name -match $appname} | Remove-AppPackage -AllUsers
}