Tales from the Datacenter
RSS

Automatically Update MDT 2010 Boot Images in WDS

October 15th, 2009 Posted in MDT, WDS, Work

I’ve been pretty busy lately getting Microsoft Deployment Toolkit set up here at the office.  We’re going to use MDT to deploy Windows 7 without creating images.  On top of that, we’re going to use WDS to serve up the boot disks from MDT over the network.

So, every time you make a change in MDT, you have to update the deployment point, which in most cases will regenerate the boot wims.  When you have four deployment points, this can be a pain just to update a task sequence.  After a bit of Googling, I found this:

You’ve probably gone through this cycle if you are using WDS to PXE boot computers to start bare metal Lite Touch deployments:

  • Import new drivers or change bootstrap.ini.
  • “Update deployment share” to generate new WIMs.
  • Import new WIMs into WDS.

Fortunately, with the new “update” process in MDT 2010 … it’s pretty simple to add a script to automate this process.

So, there’s a script you can create to do this job for you.  For posterity, the procedure is copied below.

First, create a script file – we’ll call it “UpdateExit.vbs” – and save it – we’ll save it in C:\Scripts\ for the purpose of this demonstration.  Paste the following into UpdateExit.vbs:

Option Explicit

Dim oShell, oEnv

Set oShell = CreateObject("WScript.Shell")
Set oEnv = oShell.Environment("PROCESS")

If oEnv("STAGE") = "ISO" then

    Dim sCmd, rc

    sCmd = "WDSUTIL /Replace-Image /Image:""Lite Touch Windows PE (" & oEnv("PLATFORM") & ")"" /ImageType:Boot /Architecture:" & oEnv("PLATFORM") & " /ReplacementImage /ImageFile:""" & oEnv("CONTENT") & "\Sources\Boot.wim"""
    WScript.Echo "About to run command: " & sCmd

    rc = oShell.Run(sCmd, 0, true)
    WScript.Echo "WDSUTIL rc = " & CStr(rc)

    WScript.Quit 1

End if

Now, edit “C:\Program Files\Microsoft Deployment Toolkit\Templates\LiteTouchPE.xml” and change the following (starting around line 90):

<!– Exits –>
<Exits>
  <Exit>cscript.exe "%INSTALLDIR%\Samples\UpdateExit.vbs"</Exit>
</Exits>

to look like this:

<!– Exits –>
<Exits>
  <Exit>cscript.exe "%INSTALLDIR%\Samples\UpdateExit.vbs"</Exit>
  <Exit>cscript.exe "C:\Scripts\UpdateExit.vbs"</Exit>
</Exits>

Instructions are include in the link above if MDT is installed on a different server than WDS.

Credit: Automatically Update MDT 2010 boot images in WDS

  1. 2 Responses to “Automatically Update MDT 2010 Boot Images in WDS”

  2. By Kurt on Mar 22, 2010

    Hi, I just need to know how to edit the updateexit.vbs to call a .bat file I created in the boot.wim\windows\sistem 32 to run a partition script on a txt file.

    Please help!

    Kurt

  3. By Patrick on Mar 22, 2010

    I’m afraid I don’t understand your question. Can you clarify?

Post a Comment