Create a [Mostly] Automated Reference Image in MDT – Part 1: Prerequisites

When it comes to deploying an operating system to a computer, speed and accuracy are the name of the game.  If you’re installing applications that are common across your organization as tasks in your OS deploy or installing the latest Windows updates after the deploy finishes, you can save tons of time by using a reference image.

So what is a reference image?  A reference image is a custom install of Windows that typically includes the latest Windows updates, common applications like Office, and any other customizations that are specific to computers in your environment that has been Sysprep’ed for redeployment to other computers.  Sounds easy so far, right?

If you were going to do this manually (anyone remember doing this in Norton Ghost?), here’s how it would work:

  • Boot off the install media and install the OS
  • Install all your OS updates [reboot]
  • Install Office and misc applications [probably reboot]
  • Install Office updates [probably reboot… again]
  • Make customizations [reboot for good measure]
  • Sysprep [shutdown]
  • Capture an image

So, what we want to do is get as much of that (if not all of it) automated in MDT as possible so we don’t have to do this manually.  Before we get started on doing this in Microsoft Deployment Toolkit (MDT), there are a few things you’ll need to keep in mind:

  • Automate Everything (If You Can) – Creating reference images is boring.  Period.  It’s borderline cruel and unusual punishment.  The goal here is to not have to touch the process any more than necessary.  If you’ve got application installs (or customizations) that simply can’t be scripted/automated, I’ll cover how you can handle those in later post.
  • Create the Reference Image in a VM – Virtual Machines contain fairly generic hardware and will cause you the fewest problems in the long run with your reference images.  VM’s also give you the ability to take snapshots during your build process.
  • Only Install What Everyone Needs – The goal here is to create an image that can be installed to most (if not all) of your computers.  If there are applications that only a small subset of your users get, you probably don’t want them in your reference image.  It is much easier to install the necessary apps during OS deployment than it is to remove them.
  • Avoid Constantly Updated 3rd Party Software – Just say no to applications like Flash and Java that are receive constant updates.  It is much easier (and more secure for your systems) to install those applications as a task during the deployment process.
  • Sysprep! – After your reference image is created, it will need to be Sysprep’ed. This will be included as part of the process in MDT.

Next, you’ll need the following software:

But I already have MDT up and running?  Should I keep my existing install or should I set up a separate system for creating reference images?  Personally, I like to capture reference images on a dedicated system.  First off, I don’t want to tax my MDT server unnecessarily, especially if I or any of my colleagues are deploying systems.  Second, I like to keep my Production environment and Test/Lab environment completely separate whenever I can so that I don’t blow up Production when I’m tinkering.  Third, by running MDT on the same physical box as you’re running your Hyper-V will keep all the network traffic local and significantly speed up the capture process.

Once you’ve got everything downloaded, enable Hyper-V on your host system and perform the required reboot.  Afterward, install MDT 2012 Update 1 on the host system (not a VM!) and then Windows Assessment and Deployment Kit also.  MDT is a fairly straightforward install that won’t require answering any questions (just click Next a lot).  The ADK will ask you to select which features you want to install.  You’ll want to make sure that Deployment Tools, Windows Preinstallation Environment (Windows PE), and User State Migration Tool (USMT) are installed.

01-adk_install_optionsAt this point, you should have the Microsoft Deployment toolkit and ADK installed.  You should also have your OS media together so that you can import it into MDT.  In Part 2 of this series, I’ll discuss setting up MDT, importing the operating system, and creating a task.

Series NavigationCreate a [Mostly] Automated Reference Image in MDT – Part 2: MDT Setup >>

12 thoughts on “Create a [Mostly] Automated Reference Image in MDT – Part 1: Prerequisites

  1. Erlend May 7, 2013 / 5:42 AM

    Hi, why do you recommend not installing MDT in a VM?
    The overhead in Hyper-V is very tiny, and I’ve never had any issues with it in the past 3-4 years.

    • Kyle Beckman May 8, 2013 / 7:23 AM

      What I’m discussing here isn’t a production instance of MDT; it is just for building out reference images. For a production instance of MDT, I don’t have a problem with running it from a VM.

  2. berni August 29, 2013 / 11:40 AM

    question1:
    Is it also possible to capture the original install.wim with all updates excl ie10 -> install_ie9.wim
    and after this capture the install_ie9.wim with all updates incl ie10?

    question 2:
    what parameter i must set in cs so that i have an full automated capture?

    • Kyle Beckman August 31, 2013 / 6:39 PM

      1.) Sure. Just build out a second task sequence using the IE9 WIM. Install IE10 as part of the task sequence.
      2.) In the CustomSettings.ini, add:
      TaskSequenceID=ID_OF_YOUR_TASK_SEQUENCE
      SkipTaskSequence=YES
      SkipCapture=YES

      I’m working on a post that will show how you can do both fully automated reference image creation and mostly automated reference image creation off the same share.

  3. tcox March 18, 2014 / 4:46 PM

    Hello,

    I have followed your guide and I thank you for all of your efforts! I am having a problem on both Win8.1 and Win7 deployments. After a successful deployment the AutoLogin as Admin never stops. The machine will always auto login as the Administrator account even after multiple reboots. I have checked the logs and can’t identify what is causing this problem. It seems that LTICleanup.wsf is running and deleting the reg files for auto login but the problem still exists. Any ideas?

    • Kyle Beckman March 20, 2014 / 8:38 AM

      This guide is for creating reference images, so I’m going to assume that you’re having this problem with a custom .WIM you’ve created. Honestly, that sounds like some customization gone awry. It could be a script you’re using, a program you’re installing, or even Group Policy. Just go through typical troubleshooting steps of eliminating causes. Try some test deploys using the original media to ensure it isn’t something in your Production deployment share, check your Group Policy, etc.

  4. Manoj December 28, 2014 / 3:06 PM

    Hi, I am trying to automate the build of my Windows 7 VDI reference image and being quite a novice at scripting I am struggling with how to reboot the machine 6 times and wait 120 seconds after logging on before performing the next reboot (boot prefetch training). I know how to configure autologin but just can’t seem to make the machine reboot after 120 seconds.

    I tried using the command shutdown.exe /f /r /t 120 6 times but during the install the task sequence simply steps through 6 times because I have 6 tasks but does not reboot.

    Any ideas anyone?

    • Kyle Beckman December 29, 2014 / 12:47 PM

      I haven’t used MDT for building VDI images. That said, you can’t insert you own reboots unless they’re using the built-in reboot functionality in MDT. Inserting a reboot with the shutdown.exe command is going to cause errors when the image creation process completes. The Deployment Guys has a post about doing this… though it is for an older version of MDT.

      • Martin March 6, 2015 / 3:59 AM

        In case you or anyone else is having issues adding a pause before reboot, the easiest way is to ping a non existent IP address with a time-out:
        Ping 192.0.0.2 -n 1 -w 120000 > nul
        Then you can add in a litetouch reboot task.

  5. Manoj December 29, 2014 / 2:03 PM

    Thanks! The link you provided seems to have the logic of what I am trying to do. Going to have to try it out with my limited scripting ability.

Leave a Reply