Remove preinstalled window 10 apps for all users using powershell

We all need Remove preinstalled window 10 apps for all users at some point. We can do this using powershell. The list on this page is hard to keep current, but running the following code will give you a list of the names of your currently installed packages and you can remove what you think isn’t required. It is fairly easy to re-install if required, but we still advise caution.

Get-AppxPackage -AllUsers | Select Name

To remove the preinstalled windows 10 apps for all users using powershell, open powershell as Administrator, and paste the following.

#Be careful with the first line ... you may want to keep the windows store installed as alot of applications come through there now, rather than direct installs.
#Get-appxpackage -allusers windowsstore | install-appxpackage
Get-appxpackage -allusers xboxapp | remove-appxpackage
Get-appxpackage -allusers 3dbuilder | remove-appxpackage
Get-appxpackage -allusers zune | remove-appxpackage
Get-appxpackage -AllUsers camera | remove-appxpackage
Get-appxpackage -AllUsers solitaire | remove-appxpackage
Get-appxpackage -AllUsers bing | remove-appxpackage
Get-appxpackage -AllUsers getstarted | remove-appxpackage
Get-appxpackage -AllUsers photos | remove-appxpackage
Get-appxpackage -allusers alarms | remove-appxpackage
Get-appxpackage -allusers skype | remove-appxpackage
Get-appxpackage -allusers phone | remove-appxpackage
Get-appxpackage -allusers maps | remove-appxpackage
Get-appxpackage -allusers people | remove-appxpackage
Get-appxpackage -allusers messaging | remove-appxpackage
Get-appxpackage -allusers connectivity | remove-appxpackage
Get-appxpackage -allusers communication | remove-appxpackage
Get-appxpackage -allusers candy | remove-appxpackage
Get-appxpackage -AllUsers office | Remove-AppxPackage
Get-appxpackage -AllUsers twitter | Remove-AppxPackage

If you didn’t actually read the above before copying and pasting (as we may or may not have done), you will need to re-install the store if you want it (which is likely):

Get-AppXPackage WindowsStore -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

To Add singular packages back in, use the following code

Get-appxpackage -allusers twitter | install-appxpackage

Powershell is an amazing thing that allows the reasonably knowledgeable person to do many functions easily which would normally require alot more time and or effort.

Microsoft also has a great resource on what apps are installed, system apps and if not on the list are therefore removable … Windows 10 – Apps – Windows Application Management | Microsoft Docs

Update 2021

The following list is one that I have found on a newly installed win10 machine and most of the problematic apps where removed. it should be noted that when i re-ran the list and found most of the apps still installed, so im working on a way to remove the likes of skype … good old microsoft, always doing what it thinks is right by us, despite being told to remove an app and actually showing it as removing, the app doesn’t remove … go figure.

Get-AppxPackage -AllUsers Microsoft.GetHelp | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.Windows.Photos | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.WindowsAlarms | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.WindowsCalculator | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.WindowsCamera | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.WindowsMaps | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.WindowsSoundRecorder | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.Xbox.TCUI | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.XboxGameOverlay | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.XboxGamingOverlay | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.XboxIdentityProvider | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.XboxSpeechToTextOverlay | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.YourPhone | Remove-AppPackage
Get-AppxPackage -AllUsers SpotifyAB.SpotifyMusic | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.XboxApp | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.MixedReality.Portal | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.Microsoft3DViewer | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.Getstarted | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.ZuneVideo | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.ZuneMusic | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.BingWeather | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.WindowsFeedbackHub | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.MicrosoftSolitaireCollection | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.MicrosoftStickyNotes | Remove-AppPackage
Get-AppxPackage -AllUsers Microsoft.SkypeApp | Remove-AppPackage

Remotely Lock & Shutdown computers using PowerShell

PowerShell takes the functionality of batch scripts to the next level and allows you to Remotely Lock & Shutdown computers using PowerShell.

The following needs to be run on each computer if using a workgroup setup. or changed in your AD security policy (to make it permanent – which isn’t advisable without signing the script)

https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/

Enable-PSRemoting
Set-executionpolicy unrestricted
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.250" -Force 
Get-Item WSMan:\localhost\Client\TrustedHosts
Restart-Service WinRM

The above does the following:
Enable-PSRemoting sets up the policies and firewalls to allow remote connections using powershell
Set-executionpolicy unrestricted changes the local execution policy to allow execution of all scripts (not just signed)
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.250" -Force Adds server IP into the trustedhosts to allow execution
Restart-Service WinRM restarts windows remote management service

We are assuming that your server IP is 192.168.1.250, change as appropriate

Now to the actual shutdown code that will be run from our “Server”:

Function Get-MyCredential{
 param(
 [string]$username,
 [string]$password
 )

 $secStr = new-object -typename System.Security.SecureString
 $password.ToCharArray() | ForEach-Object {$secStr.AppendChar($_)}
 return new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$secStr
}
Function Lock-Machine{
 param(
 $machineName
 )

 & winrm set winrm/config/client `@`{TrustedHosts = `"$machineName`"`}
 Invoke-Command -ComputerName $machineName -ScriptBlock { tsdiscon.exe console } -Credential (Get-MyCredential User Pa$W0rd)
 }
Function Hibernate-Machine{
 param(
 $machineName
 )

 & winrm set winrm/config/client `@`{TrustedHosts = `"$machineName`"`}
 Invoke-Command -ComputerName $machineName -ScriptBlock { &"$env:SystemRoot\System32\rundll32.exe" powrprof.dll,SetSuspendState Hibernate } -Credential (Get-MyCredential Administrator password)
}
Lock-Machine "192.168.1.84"
#Lock-Workstation "NameOfTheComputer" (Get-Credential)
Stop-Computer -ComputerName 192.168.1.85 -Force -Credential (Get-MyCredential User Pa$W0rd)