MSEndpointMgr
Home » Microsoft Endpoint Manager » ConfigMgr » Operating System Deployment » Remove Built-in apps for Windows 10 version 1809

Remove Built-in apps for Windows 10 version 1809

Since the release of Windows 10, it has been common for organization to try and reduce the footprint of built-in apps (or default apps) in their reference images, or even during bare-metal deployment. Over the years, the community has provided several solutions on how to accomplish this including myself. During this time, I’ve attempted to keep my script updated after each new release of Windows 10. You’ll find the post about the method I’m using in the script and how to use it when creating a reference image here:

Remove Built-in apps when creating a Windows 10 reference image

Now with Windows 10 version 1809 released, it’s time for another update for the remove built-in apps script.

Download script

I’ve made the script available on our GitHub repository along with all the other scripts that we’ve shared, and it’s available on the following URL:

https://github.com/MSEndpointMgr/ConfigMgr/blob/master/Operating%20System%20Deployment/Invoke-RemoveBuiltinApps.ps1

What’s new

Below is a list of changes and additions made to the latest version of the script:

  • White list has been split up from this version of the script going forward. Hopefully it will be more visually clear what has been added in terms of white listed built-in apps.
  • The following built-in apps have been added to the white list for Windows 10 version 1809:
    • Microsoft.ScreenSketch
    • Microsoft.HEIFImageExtension
    • Microsoft.VP9VideoExtensions
    • Microsoft.WebMediaExtensions
    • Microsoft.WebpImageExtension

Using the script

Reference the previous instructions from the original post mentioned above. I highly encourage you to also implement the solution at the bottom from Johan’s blog about how to turn of the automatic app updates from the Windows Store. If you intend to use this script for bare-metal deployment using e.g. ConfigMgr, that’s also supported. Simply execute the script after the operating system has been applied after the Setup Windows and ConfigMgr step.

https://deploymentresearch.com/Research/Post/615/Fixing-why-Sysprep-fails-in-Windows-10-due-to-Windows-Store-updates

Below is a few screenshot of how I’m using this script to remove the built-in apps along with Johan’s scripts when creating a reference image using MDT:

Here’s one from when you enable the app updates from Windows Store at the end before creating the WIM file:

And when using the script in ConfigMgr, here’s an example of how that could look:

(71542)

Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.

42 comments

  • Running this on 1809 Enterprise in MDT, when I run it automatically, or manually during a pause in the Task Sequence the Windows Media Player is deleted from the PC. The scripts I used to used from Niehaus (circa 2016-2016) simply don’t work on 1809.

  • Interested if anyone has considered just removing them from the WIM before the task sequence all together, and whether there was a reason people seem to rather doing it at the task sequence.???

    • Apparently messing with the WIM can cause issues with offline servicing; it’s cleaner and easier to maintain to do it in TS (or not at all)

  • I came up with a work-around for this, I wrap the Remove-AppxPackage and Remove-AppxProvisionedPackage lines in a job and give it a timeout. Haven’t had it hang since, doesn’t solve the problem of some apps not always being removed, but the script completes.
    Write-LogEntry -Value “Removing AppxPackage: $($AppPackageFullName)”

    Write-Host “Removing Package: $App”
    Start-Job -Name job1 -ScriptBlock {Remove-AppxPackage -Package $AppPackageFullName -ErrorAction Stop | Out-Null}
    Wait-Job -Name Job1 -Timeout 30
    Stop-Job -Name job1

  • Same problem here with Win 1809. It happens only on all new computers when they are joined to the domain for the first time. Works flawless when the computer is already in the domain and I just want to reinstall it.

  • Not sure why but when I try using the latest script, it isn’t removing anything. If I stay with the old script, All apps except the “White-listed” remain. I’ve even run the script manually and have the same results.

  • Padron me is this question was answered . same question Chris had
    The script works great so far, but what about the apps/programs that aren’t covered with this? Emaples are Sway, Office Lens, Microsoft to-do List, Network Speed Test, Microsoft News, etc. Some of those are showing the word “new” in blue text right below the name, but the don’t show up from a get-appxpackage command. Am I going to have to uninstall those manually?

  • I am having an issue where the script is removing my ability t print from MS Edge. I thought it may have been removing the system installed app related to printing but it isn’t. Not sure what part of the script is doing it at this point. Any help would definitely be appreciated. I am running the script before i create my wim file and not during a task sequence, not sure if it makes a difference.

    • No solution but another one experiencing the same. Our 1703 build was OK.
      1809 randomly hangs on the appx powershell removing apps. It times out on the TS and fails. In-place upgrade 1703 -> 1809 is working ok using the registry keys to prevent re-install.

    • We’ve been in contact with Microsoft about this issue and provided them with detailed debugging data, so hopefully they’re able to figure out the issue. The current state is that this behavior is mainly for devices with newer NVMe disks where it’s easy to reproduce. We’re eagerly waiting for Microsoft to fix this, but I’m not sure if it’ll be fixed for 1903/19H1.

      • Thanks, was wondering if we were the only one with the issue. Suspected network connection where its attempting to do store updates at the same time as removing them, but put in a fix that doesn’t seem to help.
        It does time out on some machines and on TS retry it goes through successfully. However on a couple of machines it seems to be re-occurring for each build on that machine (Which would make sense if its disk related). Other machines of the same model have no issues at all though, so the issue is a bit confusing. Sounds like we might not get a fix for 1809 though. Look forward to an update (Happy to help with logs if needed, assuming the current laptop we have doesn’t get fixed randomly).

      • Have there been any updates on this bug/fix?
        Currently we’re manually re-running the remove script on new device builds if this occurs, however we’ll be pushing an in-place upgrade to 1809 for existing devices soon & would be great to not get this issue crop up.

      • Hi, did MS ever get back to you with anything? We are having the same issue deploying 1809 and it is affecting about 60% of the builds

  • Also getting the hanging on 1809, which is the first time I’d attempted to remove the apps, so it’s actually a little reassuring that it isn’t something I did wrong!

  • We have been using the whitelist for a while and it usually works fine but occasionally stalls out while running.

    Has anyone tried to install any applications that were whitelisted? I am running into a situation that I need to install an app but am not able. I tried several apps that are uninstalled with this script and the powershell command does not error out but does not install the application. It just drops to the next powershell line.

    This is the command I am trying to install apps.
    Get-AppxPackage -allusers Microsoft.WindowsMaps | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}

    Thanks,
    Chris

    • Hi Chris. Yes, ours stalls out randomly too. The log file indicates it hangs on removing a provisioned app but it’s not always the same app. It seems to be happening even more after going to 1809 so we are just going to remove the apps from the WIM with OS-Builder.

      Regarding your other question, I think it is not installing the app because once the provisioned app is removed you can no longer install it without going to the Store. At least that’s been my experience.

  • I am also having the same issue as Jeremy. During my OSD TS when it is running the remove base apps powershell. It is hit and miss. Any suggestions or tricks to get this to be consistent?

  • Hi.

    Also experiencing this behaviour.
    Current 1809 Image occasionally hangs during osd.

    Seems to get stuck similar issue like described here on reddit:

    https://www.reddit.com/r/SCCM/comments/9916e2/windows_10_1803_osd_randomly_fails_on_removing/

    Adding the suggested registry keys doesn’t help either for me.

    cmd /c reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate” /v AutoDownload /t REG_DWORD /d 2 /f

    cmd /c reg add “HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent” /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f

    I’m using SCCM OSD (mdt integrated).
    Removal was done right after the “setup Windows and ConfigMgr Step”.

    I then executed the script 2-3 times in a row (cmdline with 3 minutes timeout).
    First got stuck at AppProvisioningPackage “GetHelp” and on “Solitair” on the second attempt.
    It seems that this issue increased recently with 1809.

    Anyone having similar experiences?

  • The script works great so far, but what about the apps/programs that aren’t covered with this? Emaples are Sway, Office Lens, Microsoft to-do List, Network Speed Test, Microsoft News, etc. Some of those are showing the word “new” in blue text right below the name, but the don’t show up from a get-appxpackage command. Am I going to have to uninstall those manually?

    • Scratch that. I had run the script directly on a VM that had my built and captured ref image. The script did work, it just didn’t remove everything I expected. Once I plugged it into the TS and and ran the image build again, I’m happy to report I was left with some nice blank icons with the “A great app is on its way” tooltips. (they all look like a download icon to me). Which means it removed everything I didn’t want to keep and I can now move on to creating a default start menu for users.

      One other question, what about removing the built in OneDrive?
      Would I be able to insert a run command line with the below:

      reg load “hku\Default” “C:\Users\Default\NTUSER.DAT”

      reg delete “HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run” /v “OneDriveSetup” /f

      reg unload “hku\Default”

      From the little reading I’ve done, that is supposed to keep it from installing. It won’t delete the installer, just keep it from running in the first place?

  • We ran into the same issue with 1809. The script seems to hang every time. Looks like it cannot be done anymore via a TaskSequence

  • Anyone know what the app for windows media player is called? I have been trying to whitelist and can’t figure it out.

  • The script works fine but sometimes i have a timeout on this task in my OSD (hard reset need!)
    I want to know why. Is it possible to log what happen ?

  • Hello Nickolaj,

    Thanks for this article. I was trying to run the script after installing Windows 10 1809 (not adding in TS) and it gives me the below error.

    Starting built-in AppxPackage, AppxProvisioningPackage and Feature on Demand V2 removal process
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.DesktopAppInstaller
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.Messaging
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.MicrosoftOfficeHub
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.MicrosoftStickyNotes
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.MSPaint
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.ScreenSketch
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.StorePurchaseApp
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.WebMediaExtensions
    Skipping excluded application package: Microsoft.Windows.Photos
    Skipping excluded application package: Microsoft.WindowsAlarms
    Skipping excluded application package: Microsoft.WindowsCalculator
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: microsoft.windowscommunicationsapps
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.WindowsSoundRecorder
    Skipping excluded application package: Microsoft.WindowsStore
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Starting Features on Demand V2 removal process
    Completed built-in AppxPackage, AppxProvisioningPackage and Feature on Demand V2 removal process

    I checked the Apps are there but not removed. Is it something which needs to be run only from TS?

  • This works locally for me, but doesn’t work through SCCM. I’ve included the log file below. Domain computers didn’t have access to the share until yesterday; I was hoping that was the problem, but it doesn’t seem to be. I’m a bit of a novice at this, so I apologize if I’m leaving something out.

    Skipping excluded application package: Microsoft.DesktopAppInstaller
    Skipping excluded application package: Microsoft.Messaging
    Skipping excluded application package: Microsoft.MicrosoftStickyNotes
    Skipping excluded application package: Microsoft.Windows.Photos
    Skipping excluded application package: Microsoft.WindowsAlarms
    Skipping excluded application package: Microsoft.WindowsCalculator
    Skipping excluded application package: Microsoft.WindowsCamera
    Unable to locate AppxPackage:
    Unable to locate AppxProvisioningPackage:
    Skipping excluded application package: Microsoft.WindowsSoundRecorder
    Skipping excluded application package: Microsoft.WindowsStore
    Starting Features on Demand V2 removal process
    Attempting to list Feature on Demand V2 packages failed: An attempt was made to load a program with an incorrect format.

    Completed built-in AppxPackage, AppxProvisioningPackage and Feature on Demand V2 removal process

  • Hi Nickolaj
    One thing I’ve come across with your script is that within the ‘Features On Demand V2 packages’ section, i needed to add ‘Hello.Face’ to WhiteListOnDemand otherwise Windows Hello stops working on Surface devices.. other than that, a great script
    Regards

    Steve

  • Hi Nickolaj,
    Your script works splendid for us but it seems that one buitin app doesn’t seems to go away:
    Connect; when this app is launched there is a message that says that Miracast isn’t supported on my device. Can you help me out here?

    Thanks. Regards

    Bas

  • Hi Nickolaj. Thank you for the great script! I just have a couple questions for you about it from my experience using it. I noticed the white list has some apps missing, such as the Feedback Hub for example. Would it be possible to include all the apps in the whitelist, then we can just remove what we don’t want instead of having to look up some that we might we need to add? Second, in my organization we are deploying Windows 10 1803 which includes the Mixed Reality Portal. In 1803, the Mixed Reality Portal is a feature On Demand. I noticed it wasn’t on your On Demand Feature list. I assumed it would be removed then, but it wasn’t removed. Would you be able to add that to the script as something that can be removed in 1803? My last question is for the feature NetFX3. If I keep NetFX3 in the whitelist, will it need the NetFX3 cab file for it to be added? Thanks again!

  • I’m having a hard time getting this to work consistently in the ConfigMgr deployment. I have it as one of my steps in the task sequence we image all our machines with and it will work about 30% of the time. It does the same thing if we run the script once we log into the computer. I’ve disabled and enabled Windows Store updates and that doesn’t seem to solve my problem either. This issue started happing with 1803. Before that, we used a blacklist approach and deleted all the apps we specified. I like your method much better since the apps seem to change with each OS revision. Any tips or tricks I could use to figure out what’s going on? Is anyone else having issues?

    Regards,

    Jeremy

    • We also started seeing imaging randomly hang on our remove built-in apps task starting in 1803. We use a blacklist approach. We output to a log file as apps are removed. In the logs I’ve looked at, it has not always hung up on the same app. We have also tried turning off the Store during the imaging process and still randomly have issues where imaging does not get past our remove apps task. I feel like Windows must be doing some processing or updating with built-in apps and based on timing, it may cause an error.

      We create a reference .wim in MDT and use that .wim in our Config Mgr OSD task sequence. For our 1809 images, we are going to remove the built-in apps in the reference .wim instead of during the Config Mgr OSD task sequence. We liked having it in the Config Mgr task sequence so if we changed our mind on any of the apps, we wouldn’t have to rebuild the reference .wim to make the the change.

    • Jeremy, we are seeing the same thing here. Hit and miss. Not sure what the fix would be. Anyone have suggestions?

      • My script keeps hanging during OSD as well, but it is not consistent at all. We have found a workaround by going into Taskmgr.exe to the Details tab, then scrolling down to Powershell.exe. Right-click, then select Analyze wait chain. Check/select dismhost.exe and then click End Process.

        (You may need to do this several times.)

        I really hope someone can find a better solution, because I like this script a lot.

      • Same issue here. Locks up. I have to kill DISM with task manger to get the script to continue. This is on 1809

  • Thanks for all your work on these; we’ve been using your scripts for a while now! We used to use a blacklist approach but the whitelist is much better. Starting with 1803 we’ve really struggled to get this script to run consistently (using the ConfigMgr approach in your second example with Windows 10 Education). Because we weren’t sure we also added in the Disable and Enable Windows Store updates scripts in the ConfigMgr approach too. Any thoughts on why this would fail randomly, I’d say at least 35% of the time? If I were to image a machine and run the script after logging into the machine it will fail with the same consistency. The old blacklist method fails off and on as well. I’ve spent so much time on this I’d love any feedback you could give.

    Best Regards,

    Jeremy

    • Hi Jeremy,

      I’ve also seen occasions where it would fail when running it in ConfigMgr, but I’ve not been able to replicate it and troubleshoot it further. Disabling and enabling the store updates is not a requirement though when you’re using this script for operating system deployment, only for then doing a build and capture, either with ConfigMgr or in MDT.

      Regards,
      Nickolaj

      • Thanks for letting me know we don’t have to disable and enable store updates when deploying an image from ConfigMgr. We’ll just have to come up with another way to remove store apps.

Sponsors

Subscribe

Do you want to be notified of new posts on our site?

Please enter your email address below:

Categories

MSEndpointMgr.com use cookies to ensure that we give you the best experience on our website.