Partilhar via


Speed up MDT task sequences in Configuration Manager

Here’s a quick suggestion for speeding up MDT-created task sequences in ConfigMgr 2007 or ConfigMgr 2012:

  • Find your MDT toolkit files package source folder.

  • In the “Scripts” folder inside that folder, find the “ZTISCCM.wsf” script.

  • Look for a line like this:

    wscript.sleep 30000

  • Remove that line or comment it out, then save the script.

  • Update the deployment points for that package.

Not surprisingly, that will remove a 30-second delay from the execution.  (Why is that in there?  Beats me.  I remember who put it in there – it wasn’t me – and I remember discussing it, but the logic behind it escapes me now as it did then.)

So will this cut 30 seconds out of your deployment?  For refresh deployments, yes; for bare metal deployments, it will cut 60 seconds from the deployment process.  So let’s explore that “Use Toolkit Package” step (the one that runs ZTISCCM.wsf behind the scenes) in more detail.  It has a single purpose:  It takes the contents of the MDT toolkit package (scripts, tools, etc.) and makes a copy of them on the local hard disk, setting various task sequence variables (DeployRoot, ScriptRoot, ToolRoot, etc.) to let us keep track of where they are.  As a result of this, we don’t need to download them for every single step.  But we do typically need to download them more than once.  For example:

  • In a bare metal deployment, we “temporarily” format and partition the disk if there were no existing partitions, then download the package (as the download would fail if there were no partitions present).  Later, the disk is repartitioned and reformatted, so that content was lost.  Right after that, the package is downloaded and cached again.
  • In a refresh deployment, we initially download the files to the C: drive and set all the variables to point to that location.  But when rebooting into Windows PE or a new OS, the drive letter may change.  As a result, the variables are no longer valid.  We have to download all the files just so that we can run the ZTISCCM.wsf script to find the already-cached local files.

So you’ll see a variety of “Use Toolkit Package” steps in the task sequence.  In MDT 2010 Update 1, all of these executed.  In MDT 2012, we added some conditions to the “Use Toolkit Package” steps so that they only execute when necessary.  So when are they necessary?  Any time the variables (DeployRoot, ScriptRoot, ToolRoot, etc.) aren’t valid.  So the condition was added to say “If not %ScriptRoot% exists”.  That way, the step is skipped when it isn’t needed.

In typical bare metal deployments, the step will run two or three times (with the 30-second delay happening twice).  In typical refresh deployments, the step will still run two or three times but in different times in the task sequence (with the 30-second delay only happening once).

Comments

  • Anonymous
    January 01, 2003
    It is a synchronous operation.  So like you, I don't understand the need :-)

  • Anonymous
    January 01, 2003
    Nice.

  • Anonymous
    November 06, 2012
    Its follows a folder copy operation using the File System Object....Is the file system object Synchronous in its operation? If not then I understand the sleep logic... Thanks George

  • Anonymous
    December 03, 2013
    In SCCM which condition do i need to add? "Task Sequence Variable" Thank you.

  • Anonymous
    December 03, 2013
    Variable: ScriptRoot COndition: Not exists?

  • Anonymous
    December 03, 2013
    Or If None of the cond are true: Variable  %ScriptRoot% exists?

  • Anonymous
    July 25, 2016
    Is it possible that it was about SSD starting windows too fast so the network wasn't initialize and then the research for MDT failed?