I regularly use the Microsoft Windows sysprep tool to create template Windows Server 2012 R2 systems for wider deploy using cloning. Sysprep is used to modify a pre-configured Windows system and create an image or “template” so that you can create unique copies of it for faster system deployment. Failure to use syprep before cloning a windows machine can cause odd issues, especially in an enterprise environment with Active Directory.

Sysprep is a wonderful tool but it has a few quirks. One such quirk is that it routinely wipes out all of the mounted drive information other than the system drive. This means every time you create a clone from a sysprep’d system image you have to go through and re-assign drive letters. This is fine on a simple server with one extra data server. This is a hassle on a database server which might have five extra drives.

After dealing with this again recently I finally decided to do a google search and came across a simple solution:

It requires running sysprep from the command line and manually backing up and restoring a registry key before shutting the system down. It’s a bit of extra work but doing this once is much better than going through the hassle of reassigning drive letters on every subsequent clone.

As a side note, the final syntax of my commands (ran from an elevated instance of the classic command shell) were along the lines of:

cd c:\windows\system32\syprep
sysprep.exe /generalize /oobe /quit

I have verified that this process works and volumes keep their drive letters. However drives still show up as offline on the first boot after the syprep process is over and they must be brought online before they will show up in file explorer.

Sysprep Command Line Flag Reference Guide

1 of 1

This post has no comments. Be the first to leave one!

Join the discussion

Your email address will not be published. Required fields are marked *