Friday, March 13, 2015

Using SCCM Task Sequences to perform complex application upgrades

In System Center Configuration Manager (SCCM) applications are typically deployed and managed in one of two ways: Applications and Packages.

Sometimes you need something a little more powerful. When we originally installed KwikTag, it didn't have an installer. It was a folder that had to be copied to the computers and run a batch file to register the dll's. Now we need to upgrade, which involves unregistering the dll's, deleting files out of each user's %appdata% folder, and finally deleting the folder out of "Program Files". If that weren't enough, the upgrade must include logic for "Program Files" as well as "Program Files (x86)", and I have a mix of computers with the old version, the new version, and no version installed.

Normally SCCM Task Sequences are for operating system deployment, but you can use them for much more.

When creating the Task Sequence, choose "New custom task sequence" and do not choose a boot disk.

Here's my overall "Upgrade KwikTag" Task Sequence:

You'll notice that I grouped the steps and used an "If" condition to specify to only run the TS if none of the conditions are true, as in only if the new version of the application is not installed. For all except the Install and Restart, I checked "Continue on Error" which covers those cases in which the program was never installed and the files don't exist.

My Powershell script loops through the all user's %appdata% folder and cleans up the files.