Sysprep was not able to validate your Windows installation, when run on Windows 10 and Windows 11.
When you try and run Sysprep before imaging Windows 10 or Windows 11 you may see the error
Sysprep was not able to validate your Windows installation.
Checking the log shows an error similar to this
SYSPRP Package Microsoft.OneDriveSync_21196.921.7.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
SYSPRP Failed to remove apps for the current user: 0x80073cf2.
SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
This is because Windows store apps - more information can be found here
https://docs.microsoft.com/en-US/troubleshoot/windows-client/deployment/sysprep-fails-remove-or-update-store-apps
The code in the Microsoft article isn't very clear, instead this script should help.
You can add additional packages if SysPrep fails with another package.
Clear-Host
$packages = @('*Microsoft.BingNews*','*Microsoft.OneDriveSync*')
foreach ($package in $packages)
{
Write-Host "Removing: $($package)";
Get-AppxPackage -AllUsers $package | Remove-AppxPackage -AllUsers;
Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName
-Like $package} | ForEach-Object { Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName}
}
Comments
Post a Comment