.\Matthew Long

{An unsorted collection of thoughts}

Persisting Configuration manager packages during a Task Sequence

Posted by Matthew on December 23, 2010

The Deployment Guys have a great post on persisting packages onto a machine during task sequencing so that you don’t have to repeatedly download them during the task sequence (link to follow below).

I often find that task sequences contain several custom scripts and files, stored in one or more packages that you repeatedly access. Persisting those files on the machine would save you downloading that package each time you want to access one of those files.  If you are replicating the Custom Status Backgrounds from MDT 2010 this is very useful as downloading all those bitmaps repeatedly is a bit of a waste of time.

The Deployment Guys have come up with a nice script that can do this for you, however it does have a couple of (minor) limitations..

  1. It requires the script to be inside any package you may want to persist
  2. It requires the ztiUtility.vbs script from the MDT 2010 package to also be in each package you want to prestage
  3. You can’t control the name of the folder that is created.

As noted in the blog post, you can simply use xcopy in a Run Command Line step to achieve a similar effect.  This is nice and simple and doesn’t require you to seed packages with scripts that aren’t required for their functions.  Below I’ll walk you through setting this up.

Persisting Packages

  1. Add a Run Command Line step at the point in the Task Sequence that you want to persist your package(s).  Generally you will either want to do this after you’ve handled your Disk Partition and Format steps (or repeat the steps after that point).
  2. Change the Name of your new step to something meaningful like “Persist Package x”
  3. Set the command of the package to xcopy *.* %_SMSTSMDataPath%\FolderName /s /e /h /y /c /I Noting the name of the folder that you are storing these files in.  There is nothing of course to stop you from persisting multiple packages into the same folder.
  4. Tick the Packages tick box, and select the package that you want to persist.

Running Persisted Packages

  1. Add a Run Command Line step into your Task Sequence where you wish to access your package.  Change the name to something meaningful.
  2. Set your command line up as per normal.
  3. Place %_SMSTSMDataPath%\FolderNameinto the Start in box.  This will run your command as if it was from the packages folder.

And your done!  I tend to place my persist tasks in their own group near the start of the task sequence (either the script or the method above) and then simply copy the group and paste it after my partition step to replace the files.  Obviously if you don’t need any packages till after you format then you can just create the group after the partition step in the first place.

If you want to get fancy, you can use scripts / WMI Queries and set the first group up not to persist files if a format is required or no partition exists, but that’s a topic for another post..


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s