Your day one guide to troubleshooting Sysprep

Whether you are doing bulk desktop deployment or VDI you are going to have to deal with sysprep one day. Here are my notes and some brief experiences when doing it for the purposes of Native Microsoft VDI via Remote Desktop services with Windows 8.1 as the client OS.

This post is just to annotate some common issues and troubleshooting methodologies for sysprep.

Sysprep is now included by default in Windows Vista and higher for desktop OS’es. It is included in Windows Server 2008 and higher for Server OS’es. By default, the EXE is located in “c:\windows\system32\sysprep\”. I typically run sysprep via an elevated command prompt.

There are typically two stages that sysprep can fail. Here is how to troubleshoot either:

 

1: Troubleshooting failure of Sysprep fails during the initial execution

Luckily for us, when sysprep fails during the initial run while it is still in windows, its pretty easy to diagnose.

Use notepad to view the log files in “c:\windows\system32\sysprep\Panther\“. Open up the file setuperr.log.

 

If the error surrounds “msdtcprx.dll”

run the following commands:

msdtc -uninstall
msdtc -install

then re-run sysprep.

 

If the Errors involve unsupported metro apps like : “Microsoft.Internal.Media.PlayReadyClient”

Suprise!  Microsoft’s own Metro apps don’t support being sysprepped.
Fix this by running these Powershell commands to remove the windows 8.1 metro apps:

 

get-appxpackage -allusers | where name -like “Microsoft.Internal.Media.PlayReadyClient” | remove-appxpackage
get-appxpackage -allusers | where name -like “Microsoft.WinJS.Preview.1” | remove-appxpackage
get-appxpackage -allusers | where name -like “Microsoft.WinJS.2.0.Preview” | remove-appxpackage
get-appxpackage -allusers | where name -like “Microsoft.Media.PlayReadyClient.2” | remove-appxpackage
get-appxpackage -allusers | where name -like “Microsoft.WinJS.2.0” | remove-appxpackage
get-appxpackage -allusers | where name -like “Microsoft.WinJS.2.0.Preview.Internal” | remove-appxpackage
get-appxpackage -allusers | where name -like “*VCLibs*” | remove-appxpackage

Then re-run sysprep.

 

2: Troubleshooting failure of sysprep during the first boot

This can be a little more challenging to resolve. Issues usually manifest themselves as the computer hanging at ‘configuring system...’ indefinitely or an error such as “Windows could not finish configuring the system
Before hitting OK and while the system is hung you can hit the shortcut key “[Shift]+ [F10]” to bring up a command prompt.
From here, we can see the log file but it is in an ETL format. So we need to convert it to a readable format (CSV) then open with notepad.

To do this, run the following commands:

 

cd c:\windows\panther
tracerpt setup.etl -o c:\logfile.csv
notepad.exe c:\logfile.csv

 

From there search for terms such as “failed to process” or “reg key” or “failure” to determine the application which is causing the failure. It should be pretty clear from there which application is causing the failure.

For me it was erroring out at an ESET related registry key! The resolution was to rollback the desktop to a state just prior to sysprep. Then I simply opened the ESET AV Window. Go to Setup -> Enter Advanced Setup.
Then go to Computer -> HIPS -> Uncheck “Enable Self Defense”.

Unfortunately when this happens you usually have to rebuild the image as there’s no way to repair it. Its always best to take a image backup before running sysprep.

Advertisements

Thoughts? Comments? Reply here!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: