Wednesday, March 9, 2011

SCCM Deployment Program Sequencing

I've had a few people ask me about how to run a sequence of programs in a particular order via a single SCCM advertisement.  There are a few ways to do this:

  • Using program dependencies (ie. "run another program first")
  • Using a Task Sequence
  • Using a script as a packaged program entity

The issue with the first option is that once you've installed the package, and it comes back with "failed" and you make an adjustment and try to re-run it, it won't.  SCCM won't allow a dependency-based advertisement to re-run, not even with SCCM Console Tools or SCCM Admin Tools or any of the custom add-on utilities out there.  It's a known feature of SCCM.  An advertisement that targets a Collection with a program that uses a "run another program first" sequence can only be run once per client, regardless of the outcome (e.g. "succeeded" or "failed").

Option 2 is possible, but messy at times.

Option 3 is easiest, and best.  Make a .CMD or .BAT script (almost the same thing actually) that runs the individual program commands in the desired order.  Then target that program entity via an Advertisement so that it runs only one program (the .CMD or .BAT script file).  Also, read up on the "%~dps" and "%~dps0" path expansion variables.  Use them to avoid hard-coding path locations unless absolutely necessary. 

Also - Remember that with Autodesk network deployments, the deployment .INI file forces a hard-coded UNC path reference.  Even if you load that deployment into SCCM and assign a Distribution Point, you will be wasting a lot of time and disk space for nothing.  When the advertisement runs from the hidden package deployment shares, it will read the installation location setting in the deployment .INI file and proceed to pull everything from that path location, not the Distribution Point.  And, no, you cannot enter a variable inside the .INI file to make it referential.  It's always explicit.

Cheers!

Post a Comment