// // Leave a Comment

Solution Windows 8 and Windows 8.1 A fatal error occurred while trying to sysprep the machine

Yesterday I have faced issue while running sysprep on my Windows 8.1 Enterprise desktop machine. I was trying to run Sysprep but it was failing with following error message,
System Preparation Tool 3.14
A fatal error occurred while trying to sysprep the machine
After trying lots of workaround I tried below options which are mentioned in Microsoft KB, You can also try workaround which I posted for Windows 7.

As per article,
Sysprep has an additional provider that is added in Windows 8 to clean appx packages and generalize the image. The provider will only work if the Appx package is a per-user package or an all-user provisioned package.
Per-user package means that the Appx package is installed for a particular user account and is not available for the other users of the machine.
All-user package means that the Appx has been provisioned into the image so that all users who use this image will get the App.

If an All-user package provisioned into the image was un-provisioned manually from the image, but not removed for a particular user, then during sysprep, the provider will run into an error cleaning out this package. The provider will also fail if an All-user package provisioned into the image, was updated by one of the users on this reference machine.

Way of removing package is to remove the package for the user running sysprep and also remove the provisioning.

1. Import-Module Appx
2. Import-Module Dism
3. Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe |  Format-List -Property PackageFullName,PackageUserInformation

Note -From the output of the above command, check the users for whom the package is showing up as Installed. Delete these user accounts from the reference machine, or log in to the machine using these user accounts and run Step 4 to remove the Appx Package.
The above command lists all packages that were published by Microsoft and installed by any user of that reference machine. Since the machine is to be sysprepped, we assume that these user profiles no longer need the package.
If you have manually provisioned apps belonging to other publishers, then use the command below to list them:

Get-AppxPackage -AllUser | Format-List -Property PackageFullName,PackageUserInformation

4. Remove-AppxPackage -Package <packagefullname>
5. Remove the Provisioning using the following cmdlet: Remove-AppxProvisionedPackage -Online -PackageName <packagefullname>

To run above commands open Windows Powershell as Administrator,

1. Go to C:\Windows\System32\Sysprep folder & edit Unattend.xml file & delete skiprearm=1
2. Open Registrey Editor & Set GeneralizationState to 7 under HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\
3. Open Command Prompt as Adminitrator & run below commands,
msdtc -uninstall 
msdtc -install 
4. Open Registrey Editor & Set SkipRearm to 1 Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\
5. Try to run Sysprep


Post a Comment