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

    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.    26 Oct 2015 #2
    Join Date : Sep 2015
    Posts : 2,375
    Windows 10 Pro 64-bit 1706 (CU build 15063.674)

    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.    26 Oct 2015 #3
    Join Date : Oct 2015
    Posts : 2
    Win 7, 8, 10, OSX, several versions of Linux
    Thread Starter

    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.    26 Oct 2015 #4
    Join Date : Sep 2014
    Posts : 91
    64-bit 10240 10 Pro

    How do you get into Audit Mode??
      My ComputerSystem Spec
  5.    26 Oct 2015 #5
    Join Date : Sep 2015
    Posts : 2,375
    Windows 10 Pro 64-bit 1706 (CU build 15063.674)

    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
    Join Date : Jul 2015
    Posts : 3,815
    10 Pro

    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
  7.    26 Aug 2017 #7
    Join Date : Aug 2017
    Posts : 1
    Windows 10

    Is this script working well? This would be amazing if I could comment out what I don't want removed and just run it. I haven't found anything like this anywhere on the net so please let me know.
      My ComputerSystem Spec
  8.    27 Aug 2017 #8
    Join Date : Jul 2015
    Posts : 3,815
    10 Pro

    Quote Originally Posted by madhusker View Post
    Is this script working well? This would be amazing if I could comment out what I don't want removed and just run it. I haven't found anything like this anywhere on the net so please let me know.
    It works well for me - I still use it.

    I've added more apps as they have been added and just comment out the ones I want to keep.

    Code:
    		$apps=
    		@(	
    			"4DF9E0F8.Netflix"
                            "9E2F88E3.Twitter"
    			"A278AB0D.MarchofEmpires"
    			"ClearChannelRadioDigital.iHeartRadio"
                            "D52A8D61.FarmVille2CountryEscape"
    			"Facebook.Facebook"
    			"Flipboard.Flipboard"
    			"KeeperSecurityInc.Keeper"
    			"king.com.CandyCrushSaga"
    			"king.com.CandyCrushSodaSaga"
    			"king.com.ParadiseBay"
    			"HoloCamera"
    			"HoloItemPlayerApp"
    			"HoloShell"
    			"Microsoft.3DBuilder"
    			"Microsoft.Appconnector"
    			"Microsoft.BingFinance"
    			"Microsoft.BingNews"
    			"Microsoft.BingSports"
    			#"Microsoft.BingWeather"
    			"Microsoft.ConnectivityStore"
    			"Microsoft.CommsPhone"
    			"Microsoft.Getstarted"
    			"Microsoft.Messaging"
    			"Microsoft.Microsoft3DViewer"
    			"Microsoft.MicrosoftOfficeHub"
    			"Microsoft.MicrosoftSolitaireCollection"
    			"Microsoft.MicrosoftStickyNotes"
    			"Microsoft.MSPaint"
    			"Microsoft.Office.OneConnect"
    			#"Microsoft.Office.OneNote"
    			"Microsoft.Office.Sway"
    			"Microsoft.OneConnect"
    			"Microsoft.People"
    			"Microsoft.SkypeApp"
    			"Microsoft.Windows.Phone"
    			#"Microsoft.Windows.Photos"
    			"Microsoft.WindowsAlarms"
    			#"Microsoft.WindowsCalculator"
    			#"Microsoft.WindowsCamera"
                            #"Microsoft.WindowsFeedbackApp"
    			"Microsoft.WindowsMaps"
    			"Microsoft.WindowsPhone"
    			"Microsoft.WindowsSoundRecorder"
    			#"Microsoft.WindowsStore"
    			"Microsoft.XboxApp"
    			"Microsoft.XboxSpeechToTextOverlay"
    			"Microsoft.XboxGameOverlay"
    			"Microsoft.ZuneMusic"
    			"Microsoft.ZuneVideo"
    			#"microsoft.windowscommunicationsapps"
    			"Microsoft.MinecraftUWP"
                            "PandoraMediaInc.29680B314EFC2"
    			"SlingTVLLC.SlingTV"
    			"ShazamEntertainmentLtd.Shazam"	
    			"Windows.MircastView"
    		)
    
    		Write-Host "Removing default apps" -f yellow
    		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:LOCALAPPDATA\Packages\$app*"
    			Remove-Item $appPath -Recurse -Force -ErrorAction 0			
    		}
    It was based on this project GitHub - W4RH4WK/Debloat-Windows-10: A collection of Scripts which disable / remove Windows 10 Features and Apps
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
Uninstall the Bloatware Windows 10 came with
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...
Software and Apps
Clean Install may still reinstall Mfr's Bloatware
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...
Installation and Upgrade
Solved Will the update to windows 10 remove all the Asus bloatware ?
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.
General Support
Users Want Windows 10 to Be Bloatware-Free
Source
Windows 10 News
Solved Win.old removal
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:
General Support
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 15:48.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums