Sysprep error: RunPlatformActions:Sysprep data was marked corrupt; cannot proceed
I'm working in the WVD/AVD area and often create golden images to deploy session hosts for WVD/AVD - mainly based on Windows 10 Enterprise multi-session. To do that, I create a template VM in Azure based on Windows 10, joined it to the domain, install updates and applications, and create an image based on that VM. To make my life easier, I use WVDAdmin to generate the template and rolling it out later - but this is independent of the issue with Sysprep. One step of creating an image is to Sysprep the template image. I - or WVDAdmin is doing that - by running:
sysprep.exe /generalize /oobe /shutdown /mode:vm
In the last weeks, I got the feedback that Sysprep runs into an error if you sysprep a former syspreped virtual machine again - and if Windows-updates were installed between both preparations.
The error is written in C:\Windows\System32\Panther\setupact.log is:
2021-02-09 17:17:55, Error [0x0f00d6] SYSPRP RunPlatformActions:Sysprep data was marked corrupt; cannot proceed
2021-02-09 17:17:55, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x27a
2021-02-09 17:17:55, Error SYSPRP WinMain:Hit failure while processing sysprep re-specialize internal providers; hr = 0x8007027a
It took some time, but I found a way to bring sysprep back to work (even if I didn't find the root cause of this issue). Keep in mind that this workaround doesn't resolve the unknown reason and maybe bring your image in an unsupported state.
Delete the following registry key or set it to 0: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sysprep SysprepCorrupt
Powershell:
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sysprep" -Name "SysprepCorrupt" -ErrorAction Ignore