When deploying Windows 10 CBB in an Enterprise some of the built-in apps will need to be removed for various reasons. I have used the excellent script that Ben Hunter wrote to do this in Windows 8/8.1 here http://blogs.technet.com/b/deploymentguys/archive/2012/10/26/removing-built-in-applications-from-windows-8.aspx
It removes the install .Appx packages in the list for the logged in user and the pre-provisioned package as well which means that the app is also uninstalled from the computer.
It doesn’t work anymore in Windows 10. After some investigation the reason is that the Package name is not the same for the installed Appx package as for the pre-provisioned.
Get-Appxpackage returns “microsoft.windowscommunicationsapps_17.6106.42001.0_x64__8wekyb3d8bbwe”
Get-AppxProvisionedPackage returns “microsoft.windowscommunicationsapps_2015.6106.42001.0_neutral_~_8wekyb3d8bbwe”
So I re-wrote the script to work in Windows 10, I also wrote a simple script to list all the App names that are installed on the computer so you easily can copy them to the script. It creates a file called C:\Temp\apps.txt
$Appx = Get-AppxPackage | select name
$appx | Out-File -FilePath C:\temp\Appx.txt
The updated script that will remove the packages you have in the $Applist variable and all the pre-provisioned packages. Here is the powershell script.
$AppsList = "Microsoft.BingFinance","Microsoft.BingNews","Microsoft.BingWeather","Microsoft.XboxApp","Microsoft.SkypeApp","Microsoft.MicrosoftSolitaireCollection","Microsoft.BingSports","Microsoft.ZuneMusic","Microsoft.ZuneVideo","Microsoft.Windows.Photos","Microsoft.People","Microsoft.MicrosoftOfficeHub","Microsoft.WindowsMaps","microsoft.windowscommunicationsapps","Microsoft.Getstarted","Microsoft.3DBuilder"
ForEach ($App in $AppsList)
{
$PackageFullName = (Get-AppxPackage $App).PackageFullName
$ProPackageFullName = (Get-AppxProvisionedPackage -online | where {$_.Displayname -eq $App}).PackageName
write-host $PackageFullName
Write-Host $ProPackageFullName
if ($PackageFullName)
{
Write-Host "Removing Package: $App"
remove-AppxPackage -package $PackageFullName
}
else
{
Write-Host "Unable to find package: $App"
}
if ($ProPackageFullName)
{
Write-Host "Removing Provisioned Package: $ProPackageFullName"
Remove-AppxProvisionedPackage -online -packagename $ProPackageFullName
}
else
{
Write-Host "Unable to find provisioned package: $App"
}
}
Here is a .zip file with both scripts that can be downloaded here: download
Thank you!
I have been searching high and low for instructions on how to remove the provisioning packages from Windows 10 that will work within Audit Mode and survive Sysprep.
Again, Thank you!
Thank you! You have saved me a lot of time and frustration. Before finding this, I attempted to rewrite the same script by Ben Hunter, but had no success.
Hi, If I run this script in Audit mode will the changes I make remain there? Will the apps stay deleted after following these instructions? http://www.tenforums.com/tutorials/3020-windows-10-image-customize-audit-mode-sysprep.html. ?
Hi,
If you use the script I posted it will work even if don’t use CopyProfile as was suggested in the post you linked to.
/Jörgen
Hello
I ran your script and it worked fine in the profile I ran it in. But when I created a new profile and looked in Start > All Apps > Others every app I uninstalled was listed there. Example = @{Microsoft.BingSports_4.4.2…. With a right mouse click I can uninstall this remnant of the app. Is using DISM /Online /Remove-ProvisionedAppxPackage /PackageName: a better choice?
Thanks
Hi, thanks for this!!! Much appreciated. The script works great and removes the apps but it leaves some of the boxes. They appear to be dead links to the apps that were uninstalled. Any ideas how to remove these?
Many thanks!
What command do I use in SCCM Task Sequence to run it?
Thank you! I see the ‘November Update’ puts all this crap and more back again, but using your first script i can find the names of the new stuff and edit the second script accordingly.
Hi,
November update really screw everything over. The first script produces a blank txt-file for me. And manually removing provisioned appx from the image only corrects some of the apps that pops up for new users. But some of them can’t be found with neither Get-ProvisionedAppxPackage or Get-AppxPackage. I’m refering to Flipboard and Minecraft (Xbox). And some apps can be found but not removed. Geez, win10 is not ready for business!
Hi,
Some of those are not apps but only shortcuts to apps in the Store so you an get rid of them with deploying a customized Start Menu
https://ccmexec.com/2015/09/customizing-the-windows-10-start-menu-and-add-ie-shortcut-during-osd/
and some apps are not possible to uninstall like the Windows Feedback app and the Contact Support app, you can block them with Applocker instead.
https://ccmexec.com/2015/08/blocking-built-in-apps-in-windows-10-using-applocker/
/Jörgen
Wow, thanks you, I will give this a try right away!
Any idea how to pin apps to taskbar? Prio to the November update it was possible to use the old PinnedAccplications.psm1 for Win8, but it just throws me “unknown verb” now.
/Simon
Hi,
Yes, I blogged that as well, https://ccmexec.com/2015/12/customizing-the-taskbar-in-windows-10-during-osd/
/Jörgen
Still keep getting sysprep error/failure. The setuperr.log keeps showing “Failed to removed staged package Microsoft.BingNews_4.7.118.0_x86_8wekyb3d8bbwe: 0x80070002. I have run the two scripts and even ran commands in powershell to remove BingNews.
I need some help, you say it removes the apps for people who have never logged into the PC or Laptop, but I still see this happening when a new users logs in?
I would really really appreciate a reply?
Faz
Hi,
If the user doesn’t have profile in advance on the computer, then the Remove-AppxProvisionedPackage command removes the pre-provisioned package on the computer.. they are installed per user, are Roaming Profiles in use?
/Jörgen
Dude,
Excellent A+ Thank you for sharing this. Works perfectly.
Don’t forget to run the script as admin.
This script assumes that (Get-AppxPackage $App).PackageFullName will return only one version string. Here’s an example of it returning multiples:
PS C:\> echo (get-appxPackage “microsoft.getstarted”).packagefullname
Microsoft.Getstarted_2.6.16.0_x64__8wekyb3d8bbwe
Microsoft.Getstarted_3.5.11.0_x64__8wekyb3d8bbwe
I’ve seen this happen with GetStarted, XboxApp, and ZuneMusic.
When there’s more than one, it fails like so:
Removing Package: Microsoft.ZuneMusic
Remove-AppxPackage : Cannot convert ‘System.String[]’ to the type ‘System.String’ required by parameter
‘Package’. Specified method is not supported.
I’ve updated the script to handle this:
ForEach ($App in $AppsList) {
$PackageFullName = (Get-AppxPackage $App).PackageFullName
$ProPackageFullName = (Get-AppxProvisionedPackage -online | where {$_.Displayname -eq $App}).PackageName
write-host $PackageFullName
Write-Host $ProPackageFullName
if ($PackageFullName) {
Write-Host “Removing Package: $App”
ForEach($Ver in $PackageFullName) {
Write-Host ” …version: $Ver”
remove-AppxPackage -package $Ver
}
} else {
Write-Host “Unable to find package: $App”
}
if ($ProPackageFullName) {
Write-Host “Removing Provisioned Package: $ProPackageFullName”
ForEach($Ver in $ProPackageFullName) {
Write-Host ” …version: $Ver”
Remove-AppxProvisionedPackage -online -packagename $Ver
}
} else {
Write-Host “Unable to find provisioned package: $App”
}
}
Here’s how the output looks with that fixed:
Removing Package: Microsoft.ZuneMusic
…version: Microsoft.ZuneMusic_3.6.13821.0_x64__8wekyb3d8bbwe
…version: Microsoft.ZuneMusic_3.6.15131.0_x64__8wekyb3d8bbwe
wagain, this does not seem to work with h Windows 10 professional. most organizations i have been with use Professional, not enterprise which seems what Microsoft wants you to buy!!! ugh!!!
This worked pretty well!! I took out the weather since I have no issue with my users having access to that. I don’t want to take all the fun new stuff from everyone…not yet at least.
Thanks for this little script!
Anyone having problems with this since build 1607? I’ve updated my scripts with the new package names but they are not uninstalling consistently.
Hi,
Now it works fine in my tests. what edition of Windows 10 are you using?
/Jörgen
I never tried this pre anniversary update but i have tried it now and Remove-AppXPackage and Remove-AppXProvisionedPackage no longer work for new users. Has anyone else come across this yet? Anyone got a workaround?
Hi,
It works just fine for me, what are you getting for error?
/Jörgen
Working now. Had to use Remove-AppxPackage as well Remove-AppxProvisionedPackage. Previously it worked with just Remove-AppxProvisionedPackage
Is there a way to add an app back in>
This worked well… i only took out weather as I have no issue with my users using the weather app
Testing this with W10 1607. I want to leave Photos and calculator so have amended the script accordingly. After build getting message This app has been blocked by System administrator. I am logged on as an administrator. When logging on a low rights user app doesn’t even start. Event viewer showing a GPO error for the admin but applocker hasn’t been enabled. Any thoughts?
Hi,
Do you build the image? is it a custom image? If the script is run before the user logon then the app is not there to be installed att all. so it shouldn’t show up. are you using COpyprofile?
/Jörgen
working with 1607 and getting a blank txt file with the getapps script. any ideas what i might be doing wrong?
Don’t just uninstall. Take ownership of the install file. replace the install file with your own. Then deny access to install file to all the system SIDS that will do the updating. The only way Microsoft will get around that is if they start changing the file name every time they do updates.
Example:
echo TAKE OWNERSHIP AND DENY TO MS SIDS
TAKEOWN /f “C:\Windows\SysWOW64\OneDriveSetup.exe”
Del “C:\Windows\SysWOW64\OneDriveSetup.exe”
TYPE NUL > “C:\Windows\SysWOW64\OneDriveSetup.exe”
ICACLS “C:\Windows\SysWOW64\OneDriveSetup.exe” /inheritance:d
ICACLS “C:\Windows\SysWOW64\OneDriveSetup.exe” /grant %username%:F
ICACLS “C:\Windows\SysWOW64\OneDriveSetup.exe” /deny *S-1-15-2-1:F
ICACLS “C:\Windows\SysWOW64\OneDriveSetup.exe” /deny SYSTEM:F
ICACLS “C:\Windows\SysWOW64\OneDriveSetup.exe” /deny “NT SERVICE\TrustedInstaller”:F
Pause
DIR “C:\Windows\SysWOW64\OneDriveSetup.exe”
echo SHOULD Be Zero size. LOOK LOOK LOOK, IF NOT “0” SIZE THEN RUN AGAIN!
Pause
Hi
Using Windows 10 in a multilanguage environement(A english windows 10 base image with eg. a Danish language pack offline injected) I really want to get of multiple of the default Windows apps. So i tried to use this approach in our osd task sequence running the script in online mode, it will remove the apps that I don’t want but apparently it will rename the remaining apps to their english titles(lommeregner is renamed to calculator etc.) i do experience the same thing with Nikolaj Andersens approach, unless I run the script as a loggedin user in administrator mode. Am I missing something ohow or when it should be applied? Kind regards?Jakob
Hi Jörgen.
Is it possible to use this script in a “Standard Client Upgrade Task Sequence” in MDT when upgrading from Windows 10 1507 to 1607? and how would you use it?
Br
Søren
Hello Jörgen,
We are in the need to uninstall one store-app (Microsoft Photo) on alot of our education laptops, because this store-app seems to call some function in the graphics drivers and the machine blue screens. Ive tried to get rid of the store-app with powershell but it only works for current user, and when I tried your script and deliver it with sccm one laptop it just hangs on “installing” in software center.
The Windows 10 version is 1803 and above.
Do you have any suggestion of how we can solve this?
The laptop is around 800 HP x360, and we have an supportcase at HP but we dont know when or if they can fix a new driver version.
But until then it would be very nice to have a powershell script which removes this app for all current and future users of the computer.
Take Care
Ouch!!! Sounds bad.
To uninstall it for existing users is tricky, I would divide it in to parts one that removes the pre-provisioned package which can be run under System context and that effects all new users profiles created. and on the removes the app for the user that is logged in, you could run this with GPO, Scheduled task, SCCM and so on.
Regards,
Jörgen