I recently encountered the following error while running SysPrep on a Windows Server 2022 machine recently :
Sysprep was not able to validate Windows Installation.
Looking at the SysPrep logs is necessary in order to find more about the error that was triggered. Here is the various locations of SysPrep logs :
Generalize | %WINDIR%\System32\Sysprep\Panther |
Specialize | %WINDIR%\Panther |
Unattended Windows Setup actions (OOBE) | %WINDIR%\Panther\Unattendgc |
Looking further at the SysPrep “generalize” log, I found the following :
2024-08-08 12:38:35, Error SYSPRP Package 89006A2E.AutodeskSketchBook_1.5.2.0_x64__tf1gferkr813w was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image. 2024-08-08 12:38:35, Error SYSPRP Failed to remove apps for the current user: 0x80073cf2. 2024-08-08 12:38:35, Error SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
So in my case, I went ahead and installed this package for all users using PowerShell :
Get-AppxPackage -AllUsers | ? {$_.PackageFullName -eq '89006A2E.AutodeskSketchBook_1.5.2.0_x64__tf1gferkr813w'}
Then I ran SysPrep again and no further issue occurred.