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.


You are told to check the log


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

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.