How to Resolve Sysprep Errors: When Sysprep Fails

In this post, you will learn what to do when Sysprep fails and how to fix the error: Sysprep was not able to validate your Windows installation.

Sysprep is a built-in Windows tool used to generalize OS images before deploying them to multiple machines. There are several reasons why Sysprep fails, but the error message usually states that the validation of the Windows installation has failed.

Sysprep was not able to validate your Windows installation

If Sysprep fails to create the generalized image, the first step is to check the setupact.log file. This log file can provide valuable information to help troubleshoot and resolve the Sysprep errors.

Identifying Sysprep errors in setupact.log

Sysprep generates a log file upon successful or failed completion. The log file setupact.log is located at %WINDIR%System32Panther.

setupact.log – The Sysprep log file

Based on the errors found in the setupact.log file, you can identify the root cause and apply the corresponding fixes. In the following section, we will address the known issues.

Sysprep failed to remove apps for the current user

When Sysprep encounters a failure, this is often due to conflicts that arise with Microsoft applications. A case in point is when Sysprep doesn’t succeed in removing the Microsoft Edge package, as illustrated in the following example.

The subsequent error message found in setupact.log is as follows:

SYSPRP Package Microsoft.MicrosoftEdge.Stable_120.0.2210.91_neutral_8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not operate in the sysprep image.

SYSPRP Failed to remove apps for the current users: 0x80073cf2.

In this scenario, the error SYSPRP Failed to remove apps for the current user implies that the Microsoft Edge package couldn’t be deleted. However, you can manually uninstall it by using PowerShell.

To do this, firstly launch PowerShell as Administrator and then run the following command:

SYSPRP Failed to remove apps for the current users: 0x80073cf2

Get-APPXPackage Microsoft.MicrosoftEdge.Stable Remove-APPXPackage

Removing Edge with APPXPackage

If you rerun Sysprep, the image will be generalized correctly.

Processing generalize phase using Sysprep

This example is specific to the Microsoft Edge.Stable package. However, the issue can also occur in other apps. You can check for affected apps in the setupact.txt log file.

Audit mode can’t be turned on if there is an active scenario

If pending updates exist on your machine and you then run Sysprep, setupact.log will contain the following error message:

Error SYSPRP: Audit mode can’t be turned on if there is an active scenario.; hr = 0x800F0975.

Sysprep will not work if there are active or pending updates. First, finish installing any pending updates, restart your Windows machine, and then rerun Sysprep.

Syprep fails after installing updates

Sometimes, Sysprep fails after you install new updates on your reference machine. The easiest solution is to uninstall the new updates and then rerun Sysprep.

  1. Navigate to Programs and Features > Installed Programs.
  2. Identify and select the update.
  3. Right-click on the update and then click Uninstall.
  4. Reboot Windows.
  5. Run Sysprep.

Make sure that the updates are installed after you deploy the image.

Error SYSPRP BitLocker-Sysprep

If you are using BitLocker to encrypt disks, you will encounter the following error in setupact.log when you run Sysprep:

Error SYSPRP BitLocker-Sysprep: BitLocker is on for the OS volume. Turn BitLocker off to run Sysprep. (0x80310039).

As the error implies, you must suspend BitLocker before running Sysprep. Open the File Explorer and follow these instructions:

  1. Navigate to This PC.
  2. Click on the encrypted disk and then select Manage BitLocker.

  3. Click Suspend protection.

  4. Rerun Sysprep.

A fatal error occurred while trying to Sysprep the machine

If you try to run Sysprep more than three times on the same image, you will receive this error message:

A fatal error occurred while trying to Sysprep the machine.

In the Setuperr.log file, you may encounter the following error messages:

Error [0x0f0082] SYSPRP LaunchDll: The incident occurred while executing ‘C:WindowsSystem32slc.dll, SLReArmWindows’, returned error code -1073425657

Error [0x0f0070] SYSPRP RunExternalDlls: There was an error running registry sysprep DLLs, which brought the sysprep execution to a halt. dwRet = -1073425657

Error [0x0f00a8] SYSPRP WinMain: Hit failure while processing sysprep generalize providers; hr = 0xc004d307

This error occurs when the Windows Software Licensing Rearm program runs thrice in a single image.

To avoid this error, you need to edit the SkipRearm key. This will allow you to run Sysprep more than three times.

  1. Run Registry Editor as an administrator.
  2. Navigate to ComputerHKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionSoftwareProtectionPlatform.
  3. Right-click on SkipRearm and click Edit.
  4. Enter 1 if it’s not already there, and then press Enter.

Please note the ‘Edit SkipRearm key’ from the image in the source for complete guidance.

Sysprep will not run on an upgraded OS

If you upgraded Windows, for instance, from Windows 10 to Windows 11, you will encounter the following error:

Error SYSPRP: Sysprep will not run on an upgraded OS. You can only run Sysprep on a custom (clean) install version of Windows.

The primary solution to this problem is to begin anew and install the upgraded Windows version from scratch. However, if you’ve spent a significant amount of time configuring the old image, this solution might not be the perfect fit.

The workaround below allows you to bypass the error by modifying the CleanupState registry key.

  1. Launch the Registry Editor with admin rights.
  2. Go to HKEY_LOCAL_MACHINESYSTEMSetupSysprepStatus.
  3. Right-click on the CleanupState key and alter the key to value 2.
  4. Right-click on the GeneralizationState key in registry and click the Edit option.
  5. If 7 is not present already, input it and confirm with OK.
  6. Reboot your Windows system.
  7. Execute Sysprep.

If you face any other errors when Sysprep fails, please post a comment below.


Posted

in

, ,

by

Tags: