Windows 10 built-in apps are typically removed in many corporate environments and can be difficult to remove as part of an SCCM or MDT OS deployment task sequence. This blog post “Removing Windows 10 Built-in Apps Offline WinPE Quick Guide” will provide the step-by-step instructions on how to successfully remove the Windows 10 Built-in apps during the WinPE phase (OFFLINE) of an SCCM or MDT deployment task sequence. The good news is Microsoft has a working PowerShell script created by Michael Niehaus that was published a few years ago but still works beautifully. In addition, the Microsoft provided script properly logs the removal results to the standard C:\Windows\CCM\Logs folder Post-OS deployment.
Michael Niehaus provided some great reasons for using the OFFLINE WinPE approach vs other methods. In my opinion, these are the top reasons:
- Avoid intermittent failure when the RemoveApps scripts run after the task sequence boot into Windows the first time. I’ve seen the Remove Apps ONLINE process fail at certain points of the removal process and hang the SCCM task sequence deployment – Not good.
- Avoid issues with the Windows Update agent attempting to update apps while the remove script is trying to remove them.
- I’ve tested OSDBuilder using the -RemoveAppx PowerShell parameter, but during my testing, with VLSC (Volume license media) the OSDBuilder script would say it’s removed but the apps would appear after SCCM deployment. I didn’t have time to troubleshoot why but it did work with MDSN Win10 media – Strange.
- Remove the Windows 10 Built-in apps during the WinPE (Offline) phase of the SCCM/MDT deployment task sequence
- Utilize a Remove List of apps (XML File) that should be removed/uninstalled during OS deployment WinPE phase
- Ensure each Windows 10 version is able to Remove desired Built-in apps
- Windows 10 1709 or higher (The Built-in apps removal issue applies to 1903 too)
- The SCCM Boot image must be updated to include the “Scripting (WinPE-Scripting)” and these Optional Components:
- Windows PowerShell (Winpe-DismCmdlets)
- Storage (WinPE-EnhancedStorage)
- Windows PowerShell (WinPE-StorageWMI)
- Microsoft .NET (WinPE-NetFx)
- Windows PowerShell (WinPE-PowerShell)
- Download the Microsoft provided PowerShell script “RemoveApps.ps1” and include in an SCCM or MDT package.
- Download the Sample “RemoveApps.xml“ list XML file from my GitHub site that will include the Win10 Built-in apps you want to be removed. Everything NOT in the XML file will remain and anything listed in the XML will be removed. Nice.
- Create a “Run PowerShell Script” step within the WinPE phase of the SCCM task sequence.
Download the PowerShell Script/Sample XML
Download the Microsoft PowerShell script (RemoveApps.ps1) from the original website linked here or from my GitHub website linked here. Copy this file to a network source location for the required SCCM OSD package.
Download the sample RemoveApps.xml configuration file here and place in the same folder as the PowerShell script. Your SCCM OSD package source files for this new content should look like this. Create a new SCCM OSD package with these 2 files in the network source share location and distribute the new SCCM OSD legacy package to your DP’s. No SCCM program is needed.
By default, when the PowerShell script is run, it will remove ALL Windows 10 built-in apps and create an XML file in the same location as the file. It’s recommended to use a reference PC to create the XML file for each new version of Windows 10 since Microsoft releases NEW built-in apps with some new Windows 10 versions.
Update SCCM Boot Image with PowerShell Scripting
Perform the following steps to update your SCCM default or custom MDT boot image.
From the SCCM console, select “Properties” of your boot image and click on the “Optional Components” tab, highlight “Scripting (WinPE-Scripting)“, click the orange starburst and ensure these components are selected. In this example, I’m using an MDT custom boot image since I’m using an MDT integrated SCCM task sequence.
Click “Ok” to add required components.
Click “Ok” and Distribute the boot image changes to your Distribution Point Groups or single DP.
Make sure you select “Reload this boot image with the current Win PE version from the Windows ADK” which will ensure the current ADK version binaries are updated too. This is a new SCCM feature in SCCM 1806 and higher for sure.
Create SCCM Run PowerShell Script Step
Create a NEW SCCM task sequence “Run PowerShell Script” step, reference the new SCCM OSD package, set PowerShell execution policy to “ByPass“, enter the script name, and ensure it’s listed after the “Apply Network Settings” or “Configure” TS step if you’re using an MDT integrated task sequence as shown here.
Note: If you’re using SCCM 1806 or higher, the “Run PowerShell Script” step has the features below to simply set the PowerShell execution policy and more.
RemoveApps PowerShell Script in Action
Once the boot image is updated, SCCM OSD package is created and the task sequence step is created run the deployment and the Windows 10 list of apps in the XML file will be removed. If you have enabled “F8” command line support in the boot image press F8 to launch a command line window before the step runs and you’ll see the removal status in the X:\WINDOWS\TEMP\SMSTSLOG\RemoveApps.log file using cmtrace. After the SCCM OS deployment is complete, the RemoveApps.log will be moved to the C:\Windows\CCM\Logs folder.
To run cmtrace log viewer, simple CD to the folder above and type: cmtrace RemoveApps.log and press enter.
That concludes this blog post outlining the steps needed to successfully remove the Built-in Windows 10 apps during the WinPE (Offline) phase of an SCCM task sequence deployment.
Removing Windows 10 in-box apps during a task sequence – Microsoft reference article from Michael Niehaus outlining the RemoveApps script usage.
Windows 10 WaaS Servicing Updates via OSDBuilder – IT blog post that can be used to update the Windows 10 source media with the latest Windows 10 security updates.