Thursday, April 4, 2013

How to make an unattended Sysprep for Windows (with .xml file)

submit to reddit
As I pointed out in another article (you can read it here), Sysprep is an easy way to clone a machine, especially a virtual one. I already wrote on how to make a Sysprep for Windows 8, but now I'm going to show how to make an Unattended Sysprep.

The word "Unattended" indicates that the new installation of a Sysprep machine will be automatized by some script, so settings like the computer name will be already set, and the user will have less things to do when deploying a new machine. Depending on the configuration selected in the .xml file, you can copy a machine, turn it on and just leave it until it configures itself with the settings you gave in the .xml file. Remember that when you don't use an unattended sysprep, you have to make some configurations when you deploy a new machine. To read more about this topic, click here.

This article is focused on the use of virtual machines.

Let's begin.


VMware Workstation installed (get a free trial here).

A Windows 8 Machine (get a free trial here).


1. Configure an answer file. The answer file is the .xml file you can use to customize your sysprep. The are a lot of options for this, and they all depend on what you want for the new deployed machine. To configure the answer file automatically, you can use the Windows Assessment and Deployment Kit for Windows 8 (get it here). The only problem with this is that you would have to download about 5 GB just to make your answer file.

Another option is using a template for the answer file. I looked for it in internet, and you always have to make several changes to the available example files. So, I attach an example here. You can directly use this file for the Sysprep, and as far as I tested it, you don't need to change anything for it to work. Of course, you can edit it as you want to custom your deployed machines.

Here is the complete code of the .xml file. Just copy and paste:

2. Once you have the .xml file, place it somewhere you can remember.  In my case, I copied it to C:\Windows\System32\Sysprep.

3. Open the Command Line. Go to C:\Windows\System32\Sysprep.

4. Enter the following command:

sysprep /generalize /oobe /shutdown /unattend:C:\Windows\System32\Sysprep\sysprep.xml

Press Enter. In this case, I'm assuming that the answer file's name is sysprep.xml.

5. Now, just wait until the machine shuts down.

6. Now, you can copy the VM and turn it on.  You'll see that it doesn't ask for any information, and just continues until it reaches the initial screen.

Hope it is useful for everybody!

0 comentarios:

Post a Comment