Product and service reviews are conducted independently by our editorial team, but we sometimes make money when you click on links. Learn more.

How to Automate a Windows Install

By - Source: Toms IT Pro

If you're installing Windows from a WIM or ISO file, it's possible to completely automate the install step using a single well-placed file.

Credit: ShutterstockCredit: Shutterstock

One of the biggest time drains when deploying a new Windows client or server is installing Windows itself. The wizard that comes with the install forces you to set various configuration settings ahead of time so that Windows knows how to install the operating system. The start of automating on a Windows machine is typically after this process. After all, you've got to have a platform to automate on, right? Not really.

If you're installing Windows from a WIM or ISO file, it's possible to completely automate the install step using a single well-placed file. Automating a Windows install requires a file called AutoUnattend.xml. Remember that name. It must be exactly that name when placed inside of the ISO. It's an XML file that can act as an install answer file answering each of those setup questions ahead of time.

MORE: Windows 10 for IT Pros: Tutorials, Tips and Tricks

The first task is to create this file, but in a specific way. It's always a good idea to start from a template. You can download an example template here. This file is broken down into the different phases of a Windows install; windowsPE (bootstrapping and disk configuration), specialize (setting computer name, users, etc.) and oobeSystem (local administrator password, etc.).

If you'd like to start from scratch, another useful method of creating this template is with the Windows File Answer Generator. This site provides a wizard-like interface to answer simple questions that create an unattended XML file.

By choosing to use an existing template or the Windows File Answer Generator site, it's likely the template must be modified by hand. Since the XML is strict about the structure and specific nodes, it's probable that the first version of your template will not work as expected. However, give the first version a try.

Once you have the AutoUnattend.xml file created, insert it into the Windows ISO. Unfortunately, there's not an easy way to make this happen without third party tools. Options include WinISO or use a combination of extracting and creating a new ISO file with 7Zip. Either way, the process is not as automated as you might want to think.

Next, place the AutoUnattend.xml file into the root of ISO. There are a few other places this file can be placed, but I've found it easier to put it in the root.

At the testing phase, all the hard work is done. Just attach the ISO as a media drive in your virtualization platform and start up the VM. The only difference now is that you'll see the install run entirely hands off. Once complete, Windows will be installed, and any additional scripts or configuration you've applied will have been set.