Automatically Update your MDT Reference Images
Typical workflow for handling reference images in MDT:
- Import OS install media from an ISO you downloaded off Technet / Microsoft Volume Licensing
- Build a task sequence to deploy it (I call this my Build Image task)
- Capture it to the Captures folder on your deployment share
- Import the captured OS
- Build a task sequence to deploy it (I call this my Deploy Image task)
This looks mundane, but doing steps 3, 4 and 5 sucks! Trying to remember exactly how you customized your task sequence is no way to live when it’d be way easier to re-use the existing Deploy Image task when updating your reference image. I also would love it if I’m not the only one who can perform updates to reference images ….so I figured it all out and now I live happily every after!
It’s a little extra work up front, but here’s how you can turn updating your reference images into a one step process that anyone could perform:
- Create a script called Relocate.cmd in your Scripts directory off the Deployment Share that contains the following one-liner:
move /Y "%DEPLOYDRIVE%Captures%1.wim" "%DEPLOYDRIVE%Operating Systems%1"
- Create your Build Image task. Keep the ID short. For example, let’s say we’re deploying a general purpose Windows 8 image. My Task Sequence ID that builds the reference image is 8_GP
- Run this task sequence and capture your reference image. Make sure to save it to the Captures folder and name it after your task sequence. For my example, this is .Captures8_GP.wim
- This one time, you’ll need to use the Import Operating System wizard. Be sure to name the folder for this operating system to match your task sequence that builds the reference image. For my example, I have .Operating Systems8_GP8_GP.wim
- Go back into your Build task sequence and add a custom task that runs the following command as the final step (you don’t need to set the Start In value):
cmd /? %SCRIPTROOT%Relocate.cmd %TaskSequenceID%
Note: Do to ever-vigilent WordPress Security, I had to change out the letter C to a question mark. Pleaee change it back when trying on your own.
- Create your new Deploy Image task sequence using the OS from the previous step. I recommend that for your Task Sequence ID you use something like 8_GP_DEPLOY
You’re done! At this point, to get the latest Windows Updates into an image, just run your “Build Image” task sequence – the WIM is captured and automatically replaces the OS that gets deployed when someone runs the “Deploy Image” task.
There is one word of caution: Significant changes to the OS in your WIM (Service pack, new IE version, etc.) might break the Deploy OS task. If that happens go through step 3 and step 6 again so that the MDT can “refresh” what it knows about the deployment OS you’re using