MDT Lab Builder

Version 1.1
November 17, 2014

Version 1.o    
November 10, 2014

This first version is simple and sets the foundation for further versions.  It will build a domain controller (DC01) and an MDT server (MDT01).  This works in a similar fashion to Johan Arwidmark’s Hydration Kits.  It will build a lab infrastructure for testing and working with MDT, operating system deployments, etc.  Future versions will expand the builder to include other System Center servers as well as some 3rd party SCCM-related components.

I felt that my original attempt was little more than Johan’s work with a few minor additions, and that didn’t sit well with me.  So, I started over and created this.  If you’ve used Johan’s hydration kits before, you will see the similarities easily.

The detailed documentation (which is also included in the Zip download) explains in much greater detail how the scripts work and how the CSVs can be customized to tailor the resulting builds to your preferences.

[Download the MDT Lab Builder]

There are 3 basic high-level steps to get this working:

  1. Download the builder and required software
  2. Prepare the MDT lab builder environment
  3. Build the VMs


Download the Builder and Required Software

You will need to download the following from Microsoft:

You will also need to download the MDTLabBuilder.

Prepare the MDT Lab Builder Environment


  1. Install Windows ADK (you only need the Deployment Tools and Windows PE components)
  2. Install MDT 2013

Preparing the Builder

  1. Unzip the downloaded MDTLabBuilder zip file to the location of your choice (for this document I used D:\)
    1. The Scripts folder contains the scripts and configuration files required by the builder
    2. The Staging folder will be where you place all the downloaded installers (see below for details)
  2. Populate the Source and Staging Folders

Open the file
Copy the Bginfo.exe file to:
D:\MDTLabBuilder\Staging\Applications\Install – BGInfo\Source

MDT 2013
Copy both MSIs (x86 and x64) to:
“D:\MDTLabBuilder\Staging\Applications\Install – MDT 2013\Source”

Report Viewer 2008 SP1
Copy ReportViewer.exe to:
“D:\MDTLabBuilder\Staging\Applications\Install – Report Viewer 2008 SP1\Source”

SQL Server 2012 SP1 Express
Copy SQLEXPRWT_x64_ENU.exe to:
“D:\MDTLabBuilder\Staging\Applications\Install – SQL Server 2012 SP1 Express\Source”

Windows ADK 8.1 Update
Run the following command line to download the needed components to this location:
“D:\MDTLabBuilder\Staging\Applications\Install – Windows ADK 8.1\Source”
adksetup.exe /layout “D:\MDTLabBuilder\Staging\Applications\Install – Windows ADK 8.1\Source”

Server 2012 R2 (Eval)
Mount the eval ISO
Copy the ISO contents to:

Optional: Modify the configuration CSV files to suit your preferences (see the documentation included in the download for more details)

Executing the Prep Script

  1. Open an Administrative PowerShell prompt
  2. Execute the MDT prep script (D:\MDTLabBuilder\Scripts\ 01_PrepMDTShare.ps1)
    1. This script will create and share the MDT folder (C:\_LabBuilder)
    2. Create an MDT deployment share using that folder
    3. Create the MDT build media object
    4. Configure the MDT share settings
    5. Copy the custom scripts used by the builder
    6. Import the applications defined in the configuration CSV (D:\MDTLabBuilder\Scripts\Config\MDT_AppList.csv)
    7. Import the operating systems defined in the CSV (D:\MDTLabBuilder\Scripts\Config\MDT_OSlist.csv)
    8. Dynamically generate the required CustomSettings INI files
    9. Import the custom task sequence templates required to build the lab servers
  3. Configure the MDT Build Media to generate the build ISO that will be used to build the lab servers


Build the Virtual Machines

Execute the lab building script (D:\MDTLabBuilder\Scripts\ 02_LabBuildout_HyperV.ps1) from an Administrative PowerShell prompt

The script will:

  1. Create a unique private switch in Hyper-V if it does not already exist
  2. Run through the CSV of VMs (D:\MDTLabBuilder\Scripts\Config\MDT_VMList.csv)
  • For each VM in the list it will:
    1. Create a VM based on the settings found in the CSV (Name, memory, disk size and MAC address)
    2. It will point the DVD drive at the MDT build media ISO that you’ve just created
    3. It will boot up the VM and wait for it to complete
    4. Once the VM has completed the build, MDT will automatically shut it down (FinishAction=SHUTDOWN)
    5. When the script detects that it has shut down it will boot it back up, wait 10 seconds and then repeat the process with the next VM

When the script has completed all of the defined VMs found in “MDT_VMList.csv” should be successfully built and running.

The VMs will be created in D:\VMLab (Line #66 in the script if you need to change the location)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: