Location:
State:
Carrier
Country
Status

Bloatware Removal Script


I'm working on a PowerShell script to work with Windows 10 Enterprise and my imaging tools with the intent of creating a Windows 10 image for my workplace, and remove the bloatware that comes preinstalled. For example, I can't figure out why Microsoft thinks that access to a user's Xbox Live account is required on the Enterprise (business oriented) build of a system, yet they don't make an easy way to remove this and the other bloatware applications. What I am running into at this point is that my script gets executed as my installation user and only applies to that user, where I believe that I am using the switches that are supposed to make it apply to AllUsers. The goal is to have the script run once at imaging/installation and any user can then sign in and they won't see the extra bloatware apps that we deemed are inappropriate to our workplace.

My script is as follows:
Import-Module Appx
Import-Module Dism
Get-AppxPackage *xbox* -AllUsers | Remove-AppxPackage

*Note the Get-AppxPackage line is repeated 20 some times for different packages such as *3d*, *officehub*, *skypeapp*, etc...)

Again, what is happening right now is that the script gets executed but only gets applied to the current user where as the script shows with the -AllUsers it is intended to apply to any account. I'm not a PowerShell scripting expert and would appreciate any pointers as to what I am missing to make this apply so that I can sign in with any other account to the clean interface that I am trying to configure without having to run this script for each of my user accounts. Thanks!

Hello!

Not trying to be smart here, but I read in this post that you can load Windows 10 in "audit mode". If you do any changes there, like removing unwanted apps, that should apply for all users, but not sure and cannot confirm that. Read the post and you may understand more than I do and I hope you'll find a way to automate what you want.

Audit Mode is a step in my imaging process where I'm attempting to run this script, which processes and the additional applications vanish from the Administrator account which is running Audit Mode. What is happening is that after I exit audit mode and make my image for deployment, after the image is pulled to the machine the Administrator account continues to have the appropriate applications removed, but any other account that I sign in as, my own or the user who will be using the system, has all of the apps that were removed from under Administrator.

At this point I have a script that based on my understanding is supposed to be applying to all users that is only applying to the current account which at this point if I were to deploy systems would require having to make sure that the script gets run on first login for anyone that signs into the system. I'm not a fan of complex scripting and would prefer to have it run once before we deploy a system rather than on an individual basis for 20+ users in some cases.

How do you get into Audit Mode??

Well, audit mode uses the default Administrator Account. To apply for all users, you should make these changes pass to the default user (the profile copied each time a new user is created). I don't know how you could do that. Anyone else?

You have the -AllUsersbit in redbelow which should remove it from the default profile.

I also delete the AppXProvisionedPackage and from %appdata% and WindowsApps (in green) as well... Perhaps that would help.
Code:
$apps = @(    "Microsoft.3DBuilder"    "Microsoft.Appconnector"    "Microsoft.BingFinance"    "Microsoft.BingNews"    "Microsoft.BingSports"    "Microsoft.BingWeather"    "Microsoft.Getstarted"    "Microsoft.MicrosoftOfficeHub"    "Microsoft.MicrosoftSolitaireCollection"    "Microsoft.Office.OneNote"    "Microsoft.People"    "Microsoft.SkypeApp"    "Microsoft.Windows.Phone"    "Microsoft.Windows.Photos"    "Microsoft.WindowsAlarms"    #"Microsoft.WindowsCalculator"    "Microsoft.WindowsCamera"    "Microsoft.WindowsMaps"    "Microsoft.WindowsPhone"    "Microsoft.WindowsSoundRecorder"    #"Microsoft.WindowsStore"    "Microsoft.XboxApp"    "Microsoft.ZuneMusic"    "Microsoft.ZuneVideo"    "microsoft.windowscommunicationsapps"    "Microsoft.MinecraftUWP"	)    foreach ($app in $apps) {	    Write-Host "Removing " -noNewLine; Write-Host $app -f white      # Need to hide the progress bar as otherwise it remains on the screen		    $ProgressPreference = "SilentlyContinue"    Get-AppxPackage -Name $app -AllUsers| Remove-AppxPackage    $ProgressPreference = "Continue"    Get-AppXProvisionedPackage -Online | where DisplayName -EQ $app | Remove-AppxProvisionedPackage -Online		  				    $appPath="$Env:ProgramFilesWindowsApps$app*"    Remove-Item $appPath -Recurse -Force -ErrorAction 0  						    $appPath="$Env:LOCALAPPDATAPackages$app*"    Remove-Item $appPath -Recurse -Force -ErrorAction 0}
You could look in this tutorial for sysprep - there are some problems with copy profile at the moment I think.

Windows 10 Image - Customize in Audit Mode with Sysprep - Windows 10 blog

Bloatware Removal Script