I’ve been using Jason Sandys’ OSD App Tree for a while now and it’s been a rock solid solution for me. It has provided the framework and customizability to allow deployment technicians to select applications at the beginning of an OS Deployment instead of having to visit the system post-image to install applications.
There is only one issue with it, it hasn’t been updated (at the time of this writing) since 2010 and thus doesn’t support the new Application Model introduced in Configuration Manager 2012. Sure you could just keep using the (now) “Legacy” Package/Program model, but that would potentially mean managing applications in both the Application Model AND the Legacy Packages model. Or worse yet, just not using the amazing features available in the Application Model.
Well, in times like these I’m not one to just give up. The OSD App Tree already makes use of the Dynamic Task Sequence variables to do its bidding and the new Application Model can also leverage it (with some slight differences). So with a little thinking and some PowerShell code, I present to you the Convert-OSDAppTree.ps1 script!
Here’s a rundown of what the script does:
- Accepts command line argument for your Base Variable (if none is provided it will use ‘OSDAppTreeApps’ which is the default used by the OSD App Tree)
- Gathers all Task Sequence variables that contain the Base Variable Name
- Identifies which of them is a ConfigMgr Application or Package
- Creates new Base Variables appending the word ‘Application’ or ‘Package’ to the end of your supplied Base Variable Name.
In order to use this new script and take advantage of the OSD App Tree’s customizability, you’ll need to edit a few things.
For any CM Application you want to use in the OSD App Tree, make this following edit:
- The pkgID should be equal to “CMApplication”. This is what the script looks for to determine if it’s an Application or Package.
- the progID should be the full name of the ConfigMgr Application.
Here is a sample ConfigMgr Application being referenced in the OSDAppTreeConfig.xml file:
Take special note of the Base Variable you use for the OSDAppTree. If you use anything other than the default you’ll need to make the appropriate adjustments. (NOTE: If you aren’t familiar with the OSD App Tree or the items I’m describing here, please checkout Jason’s documentation here)
After running the OSD App Tree, you’ll want to execute the PowerShell script. I like to keep this in the same package as the OSD App Tree itself.
As you can see from the screenshot, I’m using the MDT Integrated step “Run PowerShell Script” in my task sequence. You can also use a standard “Run Command Line” step with the appropriate arguments if that is your preferred method.
In the above step I’m passing my custom Base Variable Name into the Parameters box. Leave this box blank if you want to use the default OSDAppTreeApps variable name.
Install OSD App Tree Packages Step
If you currently have a step setup to install OSD App Tree generated packages, you’ll need to modify this since the script generates 2 new base variable names.
For the “Install OSD AppTree Packages” step (which is our original step we have), we simply need to change the Base Variable Name to match the new one. As you may recall from before, I chose to use the base variable name of “OSDAppTree”. Therefore the new Base Variable Name will be “OSDAppTreePackages”.
I also modified the condition for this step:
Install OSD App Tree Applications Step
Next we will create a new Install Application step and call it “Install OSD AppTree Applications”
In this step check the radio button that says “Install applications according to dynamic variable list” and give it the BaseVariable name. I also like to check the box labeled “If an application installation fails, continue installing other applications in the list”.
And last but not least we set the condition on the step.
That’s all there is to it. If you aren’t currently leveraging the OSD App Tree for your OSD Deployments, I highly recommend checking out Jason’s blog and taking it for a spin.
You can get the Convert-OSDAppTree.ps1 script here.