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/SCConfigMgr/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:

(22890)

comments
  • Jeremy
    Posted at 20:44 November 29, 2018
    Jeremy
    Reply
    Author

    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

    • Nickolaj Andersen
      Posted at 02:17 December 5, 2018
      Nickolaj Andersen
      Reply
      Author

      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

      • Jeremy
        Posted at 19:17 December 5, 2018
        Jeremy
        Reply
        Author

        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.

  • Jeremy
    Posted at 16:42 December 3, 2018
    Jeremy
    Reply
    Author

    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

    • MelQ
      Posted at 06:47 January 5, 2019
      MelQ
      Reply
      Author

      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.

    • Jacob
      Posted at 23:06 March 5, 2019
      Jacob
      Reply
      Author

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

  • Soumitra
    Posted at 15:21 February 7, 2019
    Soumitra
    Reply
    Author

    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?

  • Andre
    Posted at 12:53 February 13, 2019
    Andre
    Reply
    Author

    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 ?

  • Mike
    Posted at 18:16 February 20, 2019
    Mike
    Reply
    Author

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

    • Nickolaj Andersen
      Posted at 14:58 March 14, 2019
      Nickolaj Andersen
      Reply
      Author

      That’s a feature on demand application, it’s currently in the white list for that section.

      Regards,
      Nickolaj

  • Nxt
    Posted at 17:46 February 22, 2019
    Nxt
    Reply
    Author

    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

  • Clint
    Posted at 20:54 February 27, 2019
    Clint
    Reply
    Author

    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?

    • Clint
      Posted at 14:59 February 28, 2019
      Clint
      Reply
      Author

      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?

  • Mike
    Posted at 16:14 March 4, 2019
    Mike
    Reply
    Author

    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?

  • Jacob
    Posted at 19:03 March 6, 2019
    Jacob
    Reply
    Author

    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?

  • Chris Turner
    Posted at 17:15 March 7, 2019
    Chris Turner
    Reply
    Author

    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

    • Chris Molstad
      Posted at 22:49 March 7, 2019
      Chris Molstad
      Reply
      Author

      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.

  • Leave a Reply to Nxt
    Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.