Thursday, February 5, 2015

Deploying a Custom Windows Image with WDS, Unattended

I discovered this week that the Windows Deployment Services role on Windows Server is really great. It is possible to create your own customized Windows images to be deployed; you can load up all the software and loose files you want, no matter what type of installer your custom applications have.

The first step to getting a setup like this is installing the OS as normal on one computer. This computer will be used to perfect the configuration of the OS and all the applications and files. Do whatever you need to make the computer as all of them should be, and then generalize its configuration. Open the Sysprep utility, found at:

C:\Windows\System32\Sysprep\sysprep.exe

Choose "OOBE" from the top dropdown list, check "Generalize", choose "Shut down" from the lower dropdown list, and execute the operation. It will take a while to rip out all the machine-specific stuff, and then power off the machine.

Go to the WDS server and add the boot image for the OS, which can be found in the OS installation image (the DVD), as "\sources\boot.wim". Right-click it in the list and choose the option to create a capture image. Run through the wizard, naming it whatever you want. This creates a version of the PE image that will freeze the client computer into a WIM image for WDS. Under Install Images, create a new image group that will eventually hold the custom image.

PXE-boot the client that you just Sysprep'd into the capture image. Run through the wizard, selecting what is probably now called the D:\ drive, putting the temporary local image anywhere on the local main drive, and uploading the image to the server in the empty image group you created earlier. (This requires you to enter your credentials.) Once it completes the upload, turn off the client.

Back at the WDS server, look at the new custom install image. You're done, unless you want to make an unattend script.

To create an unattend script, you'll need the Windows System Image Manager, which is included in the Deployment Tools feature of the Windows Assessment and Deployment Kit. Install that, then export the custom install image in the WDS MMC snap-in. (The WDS image directory is not writable except by the system.) Put it somewhere on your main partition.

Open the Windows System Image Manager. Create a new answer file, selecting that exported image. Create a catalog if it asks. Then, in the lower-left pane, right-click the configuration settings you need and add them to (usually) Pass 1 or Pass 4. Pass 1 (PE settings) is the unattend script for the pre-installation environment. Pass 4 (specialization) holds settings to apply to the computer when it boots real Windows for the first time. Help with this step can be found at TechNet's Components chapter of the WDS documentation.

After you save your file in Windows SIM, open the properties of the custom install image and check the box allowing unattended installation. Specify your answer file. Then, open the properties of the WDS server itself in the WDS snap-in. Set the answer file to be the default for the appropriate architecture.

Congratulations! You can now perform an unattended deployment of a custom Windows image!

No comments:

Post a Comment