Windows 10: Bloatware Removal Script


  1. Posts : 2
    Win 7, 8, 10, OSX, several versions of Linux
       26 Oct 2015 #1

    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!
      My ComputerSystem Spec


  2. Posts : 2,235
    Windows 10 Pro 64-bit 1607 (AE build 14393.1198)
       26 Oct 2015 #2

    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.
      My ComputerSystem Spec


  3. Posts : 2
    Win 7, 8, 10, OSX, several versions of Linux
    Thread Starter
       26 Oct 2015 #3

    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.
      My ComputerSystem Spec


  4. Posts : 92
    64-bit 10240 10 Pro
       26 Oct 2015 #4

    How do you get into Audit Mode??
      My ComputerSystem Spec


  5. Posts : 2,235
    Windows 10 Pro 64-bit 1607 (AE build 14393.1198)
       26 Oct 2015 #5

    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?
      My ComputerSystem Spec

  6.    26 Oct 2015 #6

    You have the -AllUsers bit in red below 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:ProgramFiles\WindowsApps\$app*"
      Remove-Item $appPath -Recurse -Force -ErrorAction 0
    						
      $appPath="$Env:LOCALAPPDATA\Packages\$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 Forums
      My ComputerSystem Spec


 

Related Threads
This is how to uninstall the Bloatware that came with windows 10, most users won't use this. :arrow: Uninstall Apps in Windows 10 - Windows 10 Apps Features Tutorials Open Powershell as admin and enter the the code for what you want to...
From full article here - Zombie Crapware: How the Windows Platform Binary Table Works Microsoft added a new feature to Windows 8 that allows manufacturers to infect the UEFI firmware with crapware. Windows will continue installing and...
As I'm sure you're all aware, Asus (and others) love to fill up their laptop harddrives with bloatware and junk. My question is simple - when I get the upgrade to windows 10, will it automatically get rid of all that rubbish ? Thanks.
Source
Solved Win.old removal in General Support
How is the best way to remove the win.old folder from my hard drive. It was created by upgrading from version 9841 to 9860 in windows 10 tech preview. :huh:
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 16:36.
Find Us