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.

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Batch script

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

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"

Notes:

  • To find the list of all the installed apps on your device with their package names, run the following command: Get-AppxPackage | select Name, PackageFullName | Format-List
  • To find the SID of the user account, run the following command: wmic useraccount where name="Enter user account name" get sid

Uninstall a single store app for all user accounts

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

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

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
}

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository