In some cases, you may receive a “Sysprep was unable to validate your Windows installation” error when you try to generalize your Windows 10 or 11 image using command sysprep.exe /generalize /oobe /shutdown. In this article, we’ll have a look at common errors that prevent SysPrep from validating your reference Windows image.
The Sysprep (System Preparation Tool) is used to prepare a reference Windows image and depersonalize it by removing all unique identifiers (SID, GUID) from the operating system. The sysprep is used before deploying your golden Windows image on computers in the corporate network (see our guide on how to use Sysprep in Windows).
System Preparation Tool 3.14
Sysprep was not able to validate your Windows installation. Review the log file at %windir%\system32\Sysprep\panther\setupact.log for details. After resolving the issue use Sysprep to validate your installation again.
Table of Contents
How to Fix: Sysprep Was Not Able to Validate Your Windows Installation
This SysPrep may fail to validate your Windows installation for several reasons. You can find the root cause of the error in the sysprep log file (setupact.log). This file is located in the C:\Windows\System32\Sysprep\Panther directory and contains a detailed description of the error. You can open the sysprep log file with any text editor. For example, run the command:
notepad %windir%\system32\Sysprep\panther\setupact.log
Scroll through the contents of the setupact.log file from bottom to top and look for the errors. Depending on the error found, you may need to take one of the following actions to fix it.
The most common causes of this Sysprep error are:
- BitLocker encryption enabled on the system OS drive;
- Some additional Microsoft Store (UWP) apps installed;
- You accidentally removed some built-in Microsoft Store apps;
- You are using an instance of Windows that was updated from a previous version of the operating system (for example, from Windows 10 to Windows 11);
- Pending Windows Update installation.
Sysprep Fails on BitLocker-Enabled Devices
Check the setupact.log log for a BitLocker-related error:
Error SYSPRP BitLocker-Sysprep: BitLocker is on for the OS volume. Turn BitLocker off to run Sysprep. (0x80310039)
Error [0x0f0082] SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing ‘ValidateBitLockerState’ from C:\Windows\System32\BdeSysprep.dll
Open the command prompt as administrator and run the command:
manage-bde -status
It should return the following info:
Disk volumes that can be protected with BitLocker Drive Encryption: Volume C: [OSDisk] Conversion Status: Encryption in Progress
This error mostly occurs on Windows 10/11 tablets and laptops that support InstantGo (compliant devices automatically enable full BitLocker device encryption). You can fix this error by using PowerShell to turn off the encryption for the Windows system volume:
Disable-Bitlocker –MountPoint ‘C:’
Wait for the drive to decrypt. Check the status:
manage-bde -status
The drive status should change to:
Conversion Status: Fully Decrypted Protection Status: Protection Off
Sysprep can now be applied to your Windows image.
Sysprep Fails After Updating or Removing Microsoft Store Apps
SysPrep may fail after you install, update, or remove one of the provisioned Microsoft Store apps.
Check the setupact.log for the following errors:
Error SYSPRP Package SomeAppName_1.2.3.500_x64__8we4y23f8b4ws was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
Error SYSPRP Failed to remove apps for the current user: 0x80073cf2.Exit code of RemoveAllApps thread was 0x3cf2
SysPrep checks the status of Microsoft Store applications on Windows. If any of the Appx have been manually deprovisioned from the image but not removed for a particular user, or if provisioned Appx have been updated by one of the users, the SysPrep will fail.
Hint. SysPrep also fails if any of the built-in Store applications have been updated (manually or automatically) with a new version from the online Microsoft Store. To prevent automatic updates of APPX packages, open the local GPO editor console (gpedit.msc) and enable the Turn off Automatic Download and Install of updates policy in Computer Configuration > Administrative Templates > Windows Components > Store. Disconnecting your reference Windows device from the Internet can also prevent Microsoft Store apps from updating.
From setupact.log, copy the APPX ID of the application that prevents SysPrep.
Try to remove this app package using PowerShell (run the command in the PowerShell console as Administrator):
Get-AppxPackage -AllUsers | Where PublisherId -eq yourID | Format-List -Property PackageFullName,PackageUserInformation
This cmdlet lists all user profiles that have this Store application installed. If any of the local users have this package Installed, you can delete these users’ profiles, or log into each profile and delete Appx:
Remove-AppxPackage -Package 'SomeAppName_1.2.3.500_x64__8we4y23f8b4ws'
Then remove this provision package from your Windows image:
Remove-AppxPackage -Package 'SomeAppName_1.2.3.500_x64__8we4y23f8b4ws' –AllUsers
You can also delete all the local user profiles, leaving only the local Administrator profile in place. Use the netplwiz snap-in to delete additional user accounts.
Reboot the computer and try running Sysprep again.
The next time Sysprep might fail in another Microsoft Store app. Delete it also as described above.
Removing some of the built-in Microsoft Store applications may also prevent Sysprep from running. In this case, the following error will appear in setupact.log:
SYSPRP Package SomeAppName_1.2.3.500_x64__8we4y23f8b4ws was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
You must use the PowerShell one-liner to reinstall all built-in UWP apps:
Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
Sysprep Will Not Run on an Upgraded Windows Installation
If you are upgrading your operating system from an earlier version of Windows (Windows 10, Windows 8.1, or Windows 7 SP1), you should see an error in the setupact.log file when you try to run Sysprep.
Error [0x0f0036] SYSPRP spopk.dll:: Sysprep will not run on an upgraded OS. You can only run Sysprep on a custom (clean) install version of Windows.
[0x0f0082] SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing ‘Sysprep_Clean_Validate_Opk’ from C:\Windows\System32\spopk.dll; dwRet = 0x139f
Microsoft doesn’t recommend to run a Sysprep on a Windows image that has been upgraded from a previous version of Windows. The supported scenario is where you only want to sysprep a Windows image that you have after a clean installation.
However, there is a way to bypass this restriction:
- Open the Registry Editor (regedit.exe) and go to the registry key HKEY_LOCAL_MACHINE\SYSTEM\Setup;
- Delete the registry parameter named Upgrade;
- Then navigate to the key HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus and change the value of CleanupState to 7.
This will cause Sysprep to assume that this copy of Windows is being installed in a clean install mode. Restart the computer and run Sysprep again.
Sysprep Fails Due to Pending Windows Update Installation
When Windows updates are installed in the background, another SysPrep error occurs in Windows 10 and 11. In this case, Sysprep will fail with the following error in the setupact.log file:
Error SYSPRP Sysprep_Clean_Validate_Opk: Audit mode can’t be turned on if there is an active scenario.; hr = 0x800F0975
Error SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing ‘Sysprep_Clean_Validate_Opk’ from C:\Windows\System32\spopk.dll; dwRet = 0x975
Error SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Cleanup.xml; dwRet = 0x975
Error SYSPRP RunPlatformActions:Failed while validating Sysprep session actions; Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x975
To fix this Sysprep error, you need to pause Windows update via modern Settings control panel (Settings > Update & Security > Windows Update > Pause updates for 7 days).
If there are several pending updates, just wait for them to install and restart computer.
Reboot your device and try to run Sysprep.
In some cases, stopping Windows Update as described above does not completely clear the Reserved Storage. This means that you cannot use SysPrep at this time, because your Windows image is locked by some changes. This can be the installation of updates, addWindows features, system programs, antivirus, etc.
In this case, another error will appear in the sysprep log:
Error SYSPRP Sysprep_Clean_Validate_Opk: Audit mode cannot be turned on if reserved storage is in use. An update or servicing operation may be using reserved storage.; hr = 0x800F0975
To fix this issue:
- Open the Registry Editor (regedit.exe);
- Navigate to the registry key HKLM\Software\Microsoft\Windows\CurrentVersion\ReserveManager;
- Change the value of the ShippedWithReserves parameter from 1 to 0;
- Then change ActiveScenario to 0;
- And disable Reserved Storage in Windows using the command:
DISM.exe /Online /Set-ReservedStorageState /State:Disabled
2 comments
Thank you so much! After hours of stressing over the problem, this article helped me resolve the issue!
I tried 2 procedures and both of them worked. First, I sysprep the device without installing or run windows updates and it worked. Secondly, I installed all the required microsoft windows updates until there are no more update to be installed and it worked too.
The problem seems to occur when there are partial updates installed.