Enterprise Windows 10 Deployment: How to Permanently Remove Pre-installed Apps via PowerShell and DISM


1 views

When deploying Windows 10 in enterprise environments, the reappearing pre-installed apps (like Xbox, Candy Crush, and other consumer-focused applications) create significant headaches. These apps not only consume disk space but can also pose security and productivity concerns in corporate settings.

Windows 10 uses a provisioning system that automatically reinstalls these apps for new user profiles. Traditional uninstall methods (Control Panel or Settings) only remove them for the current user. Here's why they reappear:


# List all provisioned packages in Windows 10
Get-AppxProvisionedPackage -Online | Select-Object DisplayName, PackageName

Method 1: PowerShell Bulk Removal

For existing installations, run this PowerShell script (admin rights required):


# Remove apps for current user
Get-AppxPackage -AllUsers | Where-Object {$_.Name -match "xbox|candy|zune|bing|solitaire"} | Remove-AppxPackage

# Remove provisioned apps for new users
Get-AppxProvisionedPackage -Online | 
    Where-Object {$_.DisplayName -match "xbox|candy|zune|bing|solitaire"} | 
    Remove-AppxProvisionedPackage -Online

Method 2: DISM for Custom Images

When creating deployment images, use DISM to remove packages before sysprep:


# Mount your WIM file
dism /mount-wim /wimfile:install.wim /index:1 /mountdir:C:\mount

# List all packages
dism /image:C:\mount /Get-ProvisionedAppxPackages

# Remove specific packages
dism /image:C:\mount /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxApp_1.0.0.0_neutral_~_8wekyb3d8bbwe

To block Microsoft Store from reinstalling these apps:


# Registry path to disable consumer apps
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Value 1 -PropertyType DWORD -Force

Create a test deployment and verify with:


# Check for remaining provisioned packages
Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -notmatch "Calculator|Store|Photos|Camera"}

# Check for installed packages across all users
Get-AppxPackage -AllUsers | Select-Object Name, PackageFullName

For large-scale deployments, consider:

  • Creating a custom answer file for Windows Setup
  • Using MDT or SCCM for deployment automation
  • Building a golden image with all unnecessary components removed
  • Implementing AppLocker policies to prevent app reinstallation

During Windows 10 deployment in enterprise environments, pre-installed apps (often called "bloatware") like Xbox, Candy Crush, and other consumer-focused applications frequently reappear despite manual removal. This occurs because:

  • These apps are provisioned for all users during initial setup
  • Microsoft periodically pushes them through Windows Update
  • The apps are embedded in the base Windows image (install.wim)

Instead of removing apps post-deployment, we should modify the installation image itself. Here are two effective methods:

Create a deployment script that runs during system setup:


# List all provisioned packages
Get-AppxProvisionedPackage -Online | Select DisplayName, PackageName

# Remove specific provisioned packages
$appsToRemove = @(
    "Microsoft.XboxApp",
    "Microsoft.BingWeather",
    "Microsoft.Getstarted",
    "Microsoft.MicrosoftSolitaireCollection",
    "king.com.CandyCrushSodaSaga"
)

foreach ($app in $appsToRemove) {
    Get-AppxProvisionedPackage -Online | 
    Where-Object {$_.DisplayName -like "*$app*"} | 
    Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
}

# Remove for current user
Get-AppxPackage -AllUsers | Where-Object {$_.Name -in $appsToRemove} | Remove-AppxPackage

For complete control, modify the Windows image before deployment:


# Mount the Windows image
Dism /Mount-Image /ImageFile:"C:\install.wim" /Index:1 /MountDir:"C:\mount"

# List all packages in the image
Dism /Image:"C:\mount" /Get-ProvisionedAppxPackages

# Remove unwanted packages
$packageNames = @(
    "Microsoft.549981C3F5F10", # Cortana
    "Microsoft.XboxGameOverlay"
)

foreach ($package in $packageNames) {
    Dism /Image:"C:\mount" /Remove-ProvisionedAppxPackage /PackageName:$package
}

# Commit changes
Dism /Unmount-Image /MountDir:"C:\mount" /Commit

Add these Group Policy settings to prevent apps from returning:

  1. Computer Configuration > Administrative Templates > Windows Components > Cloud Content > "Turn off Microsoft consumer experiences"
  2. Computer Configuration > Administrative Templates > System > User Profiles > "Do not synchronize Windows Store apps"

For large-scale deployments, integrate these commands into your MDT task sequence:


# In your CustomSettings.ini
[Default]
OSInstall=YES
SkipApps=TRUE

# In the task sequence
Add a "Run PowerShell Script" step after "Setup Windows and ConfigMgr"

Create a verification script to audit your systems:


$remainingApps = Get-AppxProvisionedPackage -Online | 
    Where-Object {$_.DisplayName -match "Xbox|Candy|Bing|Solitaire"}

if ($remainingApps.Count -gt 0) {
    Write-Warning "Bloatware detected: $($remainingApps.DisplayName)"
    exit 1
} else {
    Write-Output "System clean - no bloatware found"
    exit 0
}