PowerShell: Removing UWP apps from Windows 10 1607/1703/1709

Update 17/10/2017: Updated post with the list of apps included in Windows 10 1709 (Fall Creators Update) by default.

Update 03/08/2017: I’ve re-written much of this post to answer some questions that have come up and to help clarify the process. Thanks to Jörgen Nilsson over at ccmexec.com, with his original post that inspired me to write this one.

When deploying Windows 10 1607/1703/1709 you might want to remove some of the included UWP apps to help speed up the log in process, save storage space, bandwidth etc. There’s a few different ways you can do this. This post will also cover how to remove UWP apps for the current logged on user.

Obtaining a List of UWP Apps

The best way to do this is to build a clean Windows 10 1607/1703/1709 image and then run the following PowerShell command:

Get-AppxProvisionedPackage -Online | Select Displayname

This will display a list of all the apps currently provisioned – apps that will be installed for new users. Personally I don’t remove all of them for my images, but ultimately, it’s up to you and what’s right for your environment.

Here’s a list of the provisioned apps in Windows 10 1709 as of 17/10/2017:

DisplayName
-----------
Microsoft.BingWeather
Microsoft.DesktopAppInstaller
Microsoft.GetHelp
Microsoft.Getstarted
Microsoft.Messaging
Microsoft.Microsoft3DViewer
Microsoft.MicrosoftOfficeHub
Microsoft.MicrosoftSolitaireCollection
Microsoft.MicrosoftStickyNotes
Microsoft.MSPaint
Microsoft.Office.OneNote
Microsoft.OneConnect
Microsoft.People
Microsoft.Print3D
Microsoft.SkypeApp
Microsoft.StorePurchaseApp
Microsoft.Wallet
Microsoft.Windows.Photos
Microsoft.WindowsAlarms
Microsoft.WindowsCalculator
Microsoft.WindowsCamera
microsoft.windowscommunicationsapps
Microsoft.WindowsFeedbackHub
Microsoft.WindowsMaps
Microsoft.WindowsSoundRecorder
Microsoft.WindowsStore
Microsoft.Xbox.TCUI
Microsoft.XboxApp
Microsoft.XboxGameOverlay
Microsoft.XboxIdentityProvider
Microsoft.XboxSpeechToTextOverlay
Microsoft.ZuneMusic
Microsoft.ZuneVideo

Here’s a list of the provisioned apps in Windows 10 1703 as of 03/08/2017:

DisplayName
-----------
Microsoft.3DBuilder
Microsoft.BingWeather
Microsoft.DesktopAppInstaller
Microsoft.Getstarted
Microsoft.Messaging
Microsoft.Microsoft3DViewer
Microsoft.MicrosoftOfficeHub
Microsoft.MicrosoftSolitaireCollection
Microsoft.MicrosoftStickyNotes
Microsoft.MSPaint
Microsoft.Office.OneNote
Microsoft.OneConnect
Microsoft.People
Microsoft.SkypeApp
Microsoft.StorePurchaseApp
Microsoft.Wallet
Microsoft.Windows.Photos
Microsoft.WindowsAlarms
Microsoft.WindowsCalculator
Microsoft.WindowsCamera
microsoft.windowscommunicationsapps
Microsoft.WindowsFeedbackHub
Microsoft.WindowsMaps
Microsoft.WindowsSoundRecorder
Microsoft.WindowsStore
Microsoft.XboxApp
Microsoft.XboxGameOverlay
Microsoft.XboxIdentityProvider
Microsoft.XboxSpeechToTextOverlay
Microsoft.ZuneMusic
Microsoft.ZuneVideo

To get a list of installed UWP apps for the current user, you should use this PowerShell command:

Get-AppxPackage | Select Name

 

Remove UWP Apps from the Current User

The script below will remove the apps specified at the top of the script from the currently logged on user’s profile. It will run without administrative privileges.

## Configure the apps to be removed
$AppsList = "Microsoft.BingWeather",
            "...",
            "Microsoft.ZuneVideo"

##Remove the Apps listed above or report if app not present
ForEach ($App in $AppsList)
{
    $PackageFullName = (Get-AppxPackage $App).PackageFullName

    If ($PackageFullName) {
        Write-Host "Removing Package: $App"
        Remove-AppxPackage -Package $PackageFullName
    }

    Else {
        Write-Host "Unable to find package: $App"
    }
}

## End

 

Remove Provisioned UWP Apps from Windows 10

The script below will remove the specified UWP apps that are provisioned in Windows 10 1703 eg. Groove Music, Photos, Mail and Calendar, etc. Please note that the Start Menu for new users will still have icons for the removed apps and they will need to be removed, either manually by the user or you can customise the Start Menu (as well as the Taskbar) using Group Policy. The script below must be run with administrative privileges.

## Configure the apps to be removed
$AppsList = "Microsoft.BingWeather",
            "...",
            "Microsoft.ZuneVideo"

##Remove the Apps listed above or report if app not present
ForEach ($App in $AppsList)
{
    $ProPackageFullName = (Get-AppxProvisionedPackage -Online | Where {$_.Displayname -eq $App}).PackageName

    If ($ProPackageFullName) {
        Write-Host "Removing Provisioned Package: $ProPackageFullName"
        Remove-AppxProvisionedPackage -Online -PackageName $ProPackageFullName
    }

    Else {
        Write-Verbose "Unable To Find Provisioned Package: $App"
    }
}

## End

 

Remove Provisioned UWP Apps from a Windows 10 .wim Image (Offline)

The script below will remove the specified UWP apps that are provisioned in a Windows 10 1703 .wim file. Please note that much like the above script the Start Menu for new users will still have icons for the removed apps and they will need to be removed, either manually by the user or you can customise the Start Menu (as well as the Taskbar) using Group Policy. The script below must be run with administrative privileges.

1709 Fall Creators Update note: There are multiple images included in 1709, so you will need to change the index to reflect the OS you wish to remove the apps from. Here’s a post from Michael Niehaus on the packaging changes and which index number you need to use for which edition of Windows 10.

## Configure the location of your image and a path to mount it
$Wim = "E:\foo\myimage.wim"
$Index = "1"
$MountPath = "E:\foo\offline"

## Configure the apps to be removed
$AppsList = "Microsoft.BingWeather",
            "...",
            "Microsoft.ZuneVideo"

## Mount the Image
Mount-WindowsImage –ImagePath $Wim –Index $Index –Path $MountPath

##Remove the Apps listed above or report if app not present
ForEach ($App in $AppsList)
{ 
    $ProPackageFullName = (Get-AppxProvisionedPackage -Path $MountPath | Where {$_.Displayname -eq $App}).PackageName

    If ($ProPackageFullName) {
        Write-Host "Removing Provisioned Package: $ProPackageFullName"
        Remove-AppxProvisionedPackage -Path $MountPath -PackageName $ProPackageFullName
    }

    Else {
        Write-Host "Unable to find provisioned package: $App"
    }
}

## Dismount the image and save changes
Dismount-WindowsImage –Path $MountPath -Save

## End

 

The Original Script

For my environment, I use the script below as a part of a MDT Task Sequence that creates my reference image. The script below is pretty much the original with some edits by me for Windows 10 1703. It’s from Jörgen Nilsson’s post on his site, ccmexec.com. The script removes the apps specified from the local administrator account (which is what the MDT Task Sequence runs as) and removes the provisioned apps from the image. During the deployment Task Sequence, the StartMenu and Taskbar are customised for the local admin account to remove the icons for apps that are no longer installed, and I also use the CopyProfile option in the unattend.xml to set the local administrator’s profile as the default for all users. This works for a very locked down environment, but for a more open environment once of the scripts above as a log on script might suffice.

$AppsList = "Microsoft.BingWeather",
            "...",
            "Microsoft.ZuneVideo"

ForEach ($App in $AppsList) {
    $PackageFullName = (Get-AppxPackage $App).PackageFullName
    $ProPackageFullName = (Get-AppxProvisionedPackage -Online | Where {$_.Displayname -eq $App}).PackageName

    If ($PackageFullName) {
        Write-Verbose "Removing Package: $App"
        Remove-AppxPackage -Package $PackageFullName
    }

    Else {
        Write-Host "Unable To Find Package: $App"
    }

    If ($ProPackageFullName) {
        Write-Verbose "Removing Provisioned Package: $ProPackageFullName"
        Remove-AppxProvisionedPackage -Online -PackageName $ProPackageFullName
    }

    Else {
        Write-Verbose "Unable To Find Provisioned Package: $App"
    }
}

 

I hope you find this useful. If you’d like to get in touch with me please leave a comment or tweet me.

-Mike

Follow Mike on Twitter: @Digressive

25 thoughts on “PowerShell: Removing UWP apps from Windows 10 1607/1703/1709

  1. Pingback: Building a Windows 10 1703 (Creators Update) Reference Image with Microsoft Deployment Toolkit | Stick To The Script!

  2. One large problem is the user this is run against has to have administrative rights to their PC. In an enterprise environment like ours, 99% of users are NOT. When you even run this as administrator, it uninstalls under that profile…not the user. From here on we’re pushing 1703 only through OSD in ConfigMgr. But we do have about 50 users that need to be upgraded. Any suggestions? Even Microsoft premier support is stuck on this one

    Like

    • What I do is run the Remove-Apps PS script during image creation in the Task Sequence. Then on deploy I use copy profile in the unattend.xml, so the default profile is free of the apps.

      Like

  3. Pingback: Walkthrough: Building a Windows 10 1703 (Creators Update) Reference Image with Microsoft Deployment Toolkit | Stick To The Script!

  4. Hi Mike,

    I’m setting up deploying Win10 v1607 with MDT and wondering where in the TS you could put this?

    Just an added note, I am adding CU KB4025339 in Preinstall area right after Inject drivers. I don’t create any hybrid images and simply use MDT to deploy the vanilla v1607 wim…..just a preference thing at the moment.

    Thanks

    Like

    • Hi Patrick, I’ve actually just updated this post to explain the process better. In my TS I put the remove-UWP-apps PowerShell script in a Custom Tasks folder after Windows Update (Post-Installation).

      Hope that helps.

      Like

  5. Hi,
    I found out an easy (?) way to clear the broken tiles that are left over after the store apps are removed and you log in as a different new user. Just run the following powershell command:
    Stop-Process -ProcessName explorer -Force
    You have to do this once per every new user that logs into the machine.

    “Luckily” in our situation this is already done by the manage taskbar script, explained here: http://ccmexec.com/2015/12/removing-the-edge-icon-from-the-taskbar-during-osd/
    Part of the script is the commandlet outlined above.

    Like

  6. Pingback: From Zero to 10 – Windows 10 Deployment Round-up | Stick To The Script!

  7. Hi,
    Can you post the screenshot of the task seqence part of the script .

    The script is running offline or onlin in the task sequence ?

    How about turing consumer experience off in the gpo ?

    Thanks

    Like

    • Hi there,

      I can post the Task Sequence but I’m currently unable to, will post it soon.

      Here’s my Task Sequence with the remove UWP apps script: UWP Apps Remove script in Task Sequence

      Personally, I run the script online.

      The Consumer Experience GPO setting prevents Candy Crush etc. from being downloaded and installed, but I’ve never had to enable it personally. I’d like to look into it a but more though, thanks!

      -Mike

      Like

  8. I’m curious what apps you are removing and which ones you are keeping. In an enterprise environment, I really don’t care if they can still access Maps or Calculator, or even paint (sometimes they put screen shots in there).

    But all the xbox stuff, candy crush saga, bubble witch saga, no need for alarms or people (they use Outlook for that kind of thing), no reason for windows store, feedback hub, etc…

    Like

    • Hi there, for me, it depends on the environment. It’s totally up to you which ones you remove and which ones you keep, I’ve just listed all of the built-in apps to be helpful. 🙂 -Mike

      Like

  9. Pingback: Walkthrough: Building a Windows 10 1709 (Fall Creators Update) Reference Image with Microsoft Deployment Toolkit | Stick To The Script!

  10. Hey Mike, first of all thanks for the script (and blog content). I would appreciate if you can give me your input on my problem with apps returning when running your script (and other similar scripts based on Remove-Appx & Remove-AppxProvisioned -online). Everything except 3 apps is removed upon startup but within minutes after first logon more apps starts to populate. I have a long technet thread here with screenshots (where one of the guys pointed me to your script):
    https://social.technet.microsoft.com/Forums/en-US/f3acd7f0-4a3e-4269-81f4-f8c6ed1fc633/how-to-actually-remove-unwanted-apps-in-windows-10-1703-?forum=ConfigMgrCBOSD

    On my latest attempts I am both removing apps in my MDT task sequence and SCCM task sequence, same issue. In advance, thank you.

    Like

    • Hi there, firstly thanks for the kind words! I see what you’re trying to achieve and I’ll try to help as best I can. Some apps like Candy Crush aren’t really installed as part of the OS, but are a stub (if you will), and when the Windows Store update process kicks in and if there’s internet access, it’ll download and install it. During my image builds, this is prevented because there’s no internet access. When deploying Windows 10, I customise the Start Menu and the Candy Crush and other apps tiles are removed, so the apps don’t try to install. There’s a GPO option that may help with this too, although I haven’t tested myself yet. More info here: https://blogs.technet.microsoft.com/mniehaus/2015/11/23/seeing-extra-apps-turn-them-off/

      Hope this helps!
      -Mike

      Like

      • Hey again Mike, my WIM file is already generated from MDT (with the scripts to remove apps running in MDT task sequence). Then I run the script a second time during OS deployment in SCCM (with the WIM file from MDT).

        Basically what happens is that the computer looks fine upon startup post OSD, but within 10-15 minutes a particular set of apps are installed. Despite these apps already haven been removed with Remove-Appx + Remove-AppxProvisioned -online . In eventlog I see one Event 43/WindowsUpdateClient event per app being re-installed. So the users will get the apps back regardless as soon as computer has Internet access, and I don’t see how image build without Internet access would change that.

        I have ended up restricting _a lot_in Registry now (including stuff on Cloud Content, hence your URL), and so far it looks fine. Although I wish I was able to get clean looking business OS without having to do all these Registry changes. With the current approach MS is taking on apps and dynamic OS changes it’s hard to tell if some registry change will give a future problem.

        Re customizing XML: My issue is, as far as I know I can only customize the tiles out on the right side. As long as an app is installed it will appear on the alphabetical start menu list on left side and there’s no way to hide them. If that was possible it would be a solution I’d be satisfied with.

        The reason why I wan’t as few apps as possible (at least no non-business software) on the left side start menu is because I am deploying Win10 to computer novice users currently using Win7. They have never seen tiles and based on their Win7 experience the first place they will try to locate software is on the left side start menu.

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s