5 June 2017

SCCM OSD - Dynamically Install Applications and Packages (Part One)

Note: This is a two part post. If you want to jump straight to the example then click here.

Preamble

There are a few ways to install packages and applications as part of an operating system deployment (OSD) task sequence(TS) in SCCM. This two part post will detail an approach to installing applications and packages which I believe provides the most flexibility and robustness. There are some blogs and posts already on the Internet about this however I found that I still had to piece everything together so I decided to post an article that I hope encapsulates everything you need to know.

Note: From this point on when I mention Applications it's also inclusive of Packages. Where settings do not apply to both I will make it clear what the differences are.

Before we get too far let's discuss where this post is going. The discussion will touch on the most common methods to installing applications highlighting the pros and cons of each. I'll then talk about the dynamic variable approach and how to configure it. The TS makes use of the ZTICoalsesce.wsf script which is part of the MDT Toolkit so you must use an MDT integrated task sequence. This approach is great for task sequences where applications may differ depending on chassis, model, country, or office. It's designed so that there is minimal effort when you need to add, modify or delete software.

Still interested? Good....

Common Application Install Methods


The following is a list of the common methods used to Install Applications. I'll try to keep this brief as there is plenty of material on the Internet should you need further reading.

1. Adding applications to the list box in the Install Applications TS step.

https://docs.microsoft.com/en-us/sccm/osd/understand/task-sequence-steps#a-namebkmkinstallapplicationa-install-application 

This is easiest option to configure. Downside to this method is two fold. You will need multiple Install Applications TS steps to accommodate different software setup. Also the list box can only hold 9 entries (starting with SCCM 1702, Microsoft has expanded that to 99 entries). If you have more than that then you need to add another step.

2. Adding applications as a collection variable.

http://schadda.blogspot.com.au/2012/02/sccm-2012-deploy-multiple-applications.html

In this method you're using the Base Variable Name on the bottom of the Install Applications step and adding that as a collection variable with numbered suffix. The suffix must start from 01 for Applications or 001 for Packages and it must be unique and sequential. The problem with this method is that there is no way to re-sort your application list should you want to change the order your applications are installed. You'll have the same problem if you need to delete an application from the start or middle of the list. You will basically need to re-do the list when that happens.

3. Adding applications using the Set Dynamic Variables task sequence step.

https://docs.microsoft.com/en-us/sccm/osd/understand/task-sequence-steps#a-namebkmksetdynamicvariablesa-set-dynamic-variables

This is similar to point #2 but instead you use the Set Dynamic Variables to list your applications. It's a little bit more flexible than using collection variables as you can move variables up and down the list but it still has the same numbering rules so you'll need to re-number your variables if changes to applications are made.

Is there a better way?

 

OK, so setting Dynamic Variables is halfway to what we want but the whole sequential numbering system makes the job harder for us deployment technicians. Fortunately the people at Microsoft have given us the magic we need, ZTICoalesce.wsf which is part of the MDT Toolkit. What it does is that it will automatically re-number our applications into a sequential order. Before I go any further, here are the rules:

  1. You must have Windows ADK installed so you can use the MDT integrated task sequence. If you've only had exposure to the default SCCM task sequence then I suggest you try it out.
  2. You must add the Use Toolkit Package task sequence step somewhere before the coalesce step. ZTICoalesce.wsf is part of this package.
  3. Defining the numbered suffix in Applications and Packages is slightly different.
    • Applications will only install if the suffix is 2 numbers. e.g. If APPS is the base variable name then the numbering system is APPS01.
    • Packages will only install if the suffix is 3 numbers. e.g If PACKS is the base variable name then the numbering system is PACK001.
  4. Referencing Applications and Packages in your task sequence (or CustomSettings.ini file) is also different.
    • Applications use the actual Application name. That's all you need to enter.
    • Packages require more detail and it must be entered in particular format. That format is PackageID:NameOfProgram. That might not make much sense right now but I will show an example in Part Two.
Want to see an example? Continued in Part Two.

-- Matt

2 comments:

  1. If i put the Pkgs001=ID:Name in the custom.ini file do i need to still set dynamic variables in state restore?

    ReplyDelete
    Replies
    1. Sorry for the extremely late reply. I'll respond in case anyone else has the same question. If you're using CustomSettings.ini to define your apps, then you do not need to define then in a Set Dynamic Variables step. Just make sure that you have your Use Toolkit Package and Gather steps in the right place.

      Delete