Windows – Creating a Sysprep answer file

Sysprep allows you to image a customized windows installation and “clone” that to other similar systems.  It is described in detail by Microsoft at: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep–system-preparation–overview

I have always used sysprep answer files when using sysprep. The process to create these answer files is a bit obtuse.

You first need to install the Windows WAIK that matches the version of windows you intend to image.  This installs as a windows kit and includes the “Deployment and Imaging Tools” command line need to create a WinPE installation environment.

You also need a copy of the installer for the windows version you intend to deploy on a burned DVD.

Then with the windows installer DVD in the drive, open the “Windows System Image Manger” in the Windows WAIK kit.

Now the trick to creating a good sysprep file is to ONLY include the components and packages from the windows installation DVD in the answer file that you absolutely need (There are thousands of components!). See the Sysprep best practices at: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/hh825023(v=win.10)

Basically, you should expend out the components in the DVD in the bottom left window above.  Select the ones you really need and drag copy them into the sysprep step in the middle of the window above you want them in. Then once they are there, one can set the settings or parameters as you need to.

The complete sysprep technical reference is at: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/hh825209(v=win.10)

There are also many examples of creating sysprep answer files on many different websites.  One that is a little older is at: http://sybaspot.com/the-complete-guide-to-preparing-a-windows-7-deployment-image-using-audit-mode-and-sysprep-with-an-unattend-xml-answer-file/

It is important in any of these to not blindly copy the sysprep settings that other people use.  You need to review the required settings and select only the optional ones you really need.  (For Williams College people – get a copy of the sysprep files that Lynna has on the winlab file server that netsys maintains at: \\winlab\images\Lab Image Work\Sysprep\).

Once you have a sysprep file you think you want to test load your windows version on a clean system.  Then:

Before sysprepping a computer make a backup image!
Incorrect Sysprep answer files can and often do result in an unbootable/unfixable windows install.

Be sure to completely shutdown the computer (not just reboot)

If using “CopyProfile” —- Log into the ProfileUser account and set it up the way you want it. Do not log into any other accounts.
(If you do log into other accounts you should shutdown the system completely before continuing to sysprep.)

Make sure the correct sysprep answer file is copied to “c:\windows\system32\sysprep\unattend.xml”

From the ProfileUser account:
Right click on cmd.exe and select “run as administrator” (type “cmd.exe” in the search windows)

Then use these commands:

cd c:\windows\system32\sysprep

sysprep /generalize /oobe /shutdown /unattend:c:\windows\system32\sysprep\unattend.xml

 

Since it can be a vector to compromise windows system security, After deploying computers using a sysprep answer file, a post-cloning task should be to remove the sysprep answer file from the cloned systems

This entry was posted in Labs and tagged , , . Bookmark the permalink.

Comments are closed.