I'm a server admin and I don't often deal with client devices, but I'm currently trying to figure out how to stop specific apps like Outlook, OneDrive, and Xbox Games from being installed for new users when they log into a Windows 11 PC for the first time. I've used the command `Get-AppxPackage -AllUsers -Name Microsoft.OutlookForWindows | Remove-AppxPackage -AllUsers` and it works for existing users, but new users still see these apps when they log in. I also tried to remove the provisioning package with the command `Get-AppxProvisionedPackage -Online -PackageName Microsoft.OutlookForWindows`, but that failed. This whole situation feels unnecessarily complicated!
4 Answers
You have a couple of options. The command you mentioned for removing provisioned packages is correct. However, you can’t remove a provisioned package if it’s already been installed for any user. Ideally, you should run your initial command to remove the package first, which should affect all users, and then follow up with the second command. If you're really stuck, one option is to sign in as the built-in local admin, which won't have those packages provisioned, delete other user profiles, reboot, and then try to remove the package again. Back when I managed Windows 8 & 10, we had a PowerShell script to update app installations during deployment, which really helped. Nowadays, using Intune might be the best approach, as it allows you to deploy and remove apps smoothly.
Here's a script I use to target what apps get deployed to clients. You just have to modify the array to add or remove apps as needed:
```
$Apps = @(
"*Microsoft.GetHelp*"
"*Microsoft.Getstarted*"
"… (list other target apps here)
)
foreach ($App in $Apps) {
Get-AppxPackage -AllUsers -Name $App | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $App | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Write-Output "Uninstalling $App."
}
```
This should give you more control over what's being installed.
Have you tried enabling the policy called 'Do not show Windows welcome experience after updates'? There are also new policies for controlling app installations these days. That setting should prevent consumer apps from being installed for new users, but I think it might be limited to business editions of Windows, not consumer ones.
There are essentially two steps you need to take. First, make sure to unpin all Start Apps right away using: `Export-StartLayout C:UsersDefaultAppDataLocalMicrosoftWindowsShellDefaultLayouts.xml`. Then, use `Remove-AppxProvisionedPackage -Online -AllUsers -PackageName "Microsoft...."` for each specific app you want to target. This should stop those applications from popping up for new users.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures