Lab Automation: Unattended Windows Deployments including AD Forests, Domains and SQL server – Part I: Overview

As part of the work I do for VMware, I build and reset and build labs over and over again. As any engineer with a touch of OCD will attest to, gremlins get in somehow/somewhere, and after a few resets things start to look like the Stranger Things Upside-Down version of themselves. There is nothing quite like a fully fresh environment to allow you sleep at night.

When we build our VVD test labs, we need IaaS templates and a SQL Server for vRealize Automation. So I figured it was time to dust off the unattended installation part of my brain’s archive and see if I could get this to work in a fully automated fashion including all pre-requisites. Just for the fun of it I thought I’d automate the deployment of the supporting AD Forest/Domain structure too.

All via PowerShell, using JSON as the format for inputs.

Pieces of the Puzzle

So there are several elements to an unattended Windows installation.

  • How are you going to bring all the required binaries and drivers together?
    • Answer: Windows 10 ADK
  • How are you going to setup the basic machine identity
    • Answer: autounattend.xml
  • How are you going to further customize it once Windows is installed
    • Answer: SetupComplete.cmd to trigger a PowerShell script that does the rest

Overall, the goal is to create a VM Deployment flow like this:

We are going to use the fact that Windows will search the root of all mounted drives during installation of the OS to place this file outside of the main binaries iso. This means each VM will use two ISOs when deploying. One large (and common) one with all the binaries, and one tiny on (about 2MB) that holds all the stuff that will make the VM unique.

In the next post in this series I’ll show you how to create the single binaries iso that can be leveraged by all the VMs we wish to deploy. Subsequent posts will take you through the theory of how the answer files and post-configuration files work and get created, and finally I’ll provide specific examples of those files for Root Domains, Child Domains, Additional Domain controllers, Member Servers and SQL Servers.

Posts in this Series