Getting the OSDAppTree to work with ConfigMgr 2012 Applications

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:

  1. 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)
  2. Gathers all Task Sequence variables that contain the Base Variable Name
  3. Identifies which of them is a ConfigMgr Application or Package
  4. 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.

OSDAppTreeConfig.xml

For any CM Application you want to use in the OSD App Tree, make this following edit:

  1. The pkgID should be equal to “CMApplication”.  This is what the script looks for to determine if it’s an Application or Package.
  2. the progID should be the full name of the ConfigMgr Application.

Here is a sample ConfigMgr Application being referenced in the OSDAppTreeConfig.xml file:

image

Task Sequence

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.

image

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.

image

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”.

image

I also modified the condition for this step:

image

Install OSD App Tree Applications Step

Next we will create a new Install Application step and call it “Install OSD AppTree Applications”

image

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”.

image

And last but not least we set the condition on the step.

image

 

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.

Advertisements

Author: dhedges

I'm a Senior Client Systems Engineer specializing in OS Deployments and Automation using VBScript, PowerShell, MDT and SCCM. I enjoy working with technology and bending it to my will.

21 thoughts on “Getting the OSDAppTree to work with ConfigMgr 2012 Applications”

  1. In SCCM 2007 I was using the apptree and it worked fine. I’m trying to follow your instructions to get it to work in 2012 and have some problems. My 1st question is do I have to enter a “Condition”. In 2007 I was not using a condition, just not sure if I have to use condition with 2012?

    1. No, you don’t need to use the option in the AppTree. We use that for other purposes. The only thing you need to do to reference anything within the Application Model is set the prgId = “CMApplication” and set progId equal to the Application Name (as it’s referenced in the console).

      The Condition is only used to determine whether or not an application is displayed, default, mandatory and not used to determine what the application is being referenced to on the backend.

      -Dustin

      1. Thank you. My TS is failing as soon as it tries to run “Convert-OSDAppTreeApps.ps1”
        I’m using the Run PowerShell Script integrated MDT that you mentioned above.
        In my TS, under Install Operating System I have my “Run OSDApp Chooser” TS and it runs, then right after that I have the “Convert OSDAppTree Variable TS and immediately fails with error 0x00000001.
        Any ideas?

      2. I have mine set to rum immediately after the OSD AppTree is executed instead of waiting. Have you looked at the log file that gets created when you run the script?

    2. For some reason my applications work fine in SCCM 2012R2 with OSDApptree and I have assigned the variable OSDAppTreeAppsApplications but when trying to get a package installed, it fails. I have assigned the variable OSDAppTreeAppsPackages in the task sequence but am not sure what to do next to troubleshoot. Should the progid for a package still be the name or the package number ? The log file has no errors

      1. Hi Brian,

        Yes, you should have 2 steps (as outlined in the blog) with the OSDAppTreeAppsApplications & OSDAppTreeAppsPackages variables. The Packages/Programs that you are referencing should be setup exactly as they are in Jason’s documentation for the OSD App Tree.

  2. I have mine set to run immediately after as well. I changed to continue on error and tried again.
    As far as the OSDAppTree.log it looks good no errors.
    Here it is:

    Now when I check the smsts.log I did notice the following, but no errors:
    The action (Install OSD AppTreeApplications) has been skipped because the condition is evaluated to be false
    And
    The action (Install OSD AppChooserPackages) has been skipped because the condition is evaluated to be false

  3. Does it matter that my OSDAppTree Package is in SCCM 2012 as a package or do I need to create an Application for it?

  4. Figured it out. Out boot images were missing Microsoft.NET (WinPE-NetFx4) and Windows Powershell (WinPE-PowerShell3).

      1. Sorry in your previous post Dustin said certain things were missing from his boot image? I seem to be having similar issues so was wondering how he got resolved the missing components in his boot image?

      2. Go to the properties of your boot image under Software Library. Then when in the properties select the Optional Components tab. We added Microsoft .NET (WinPE-NetFx4) and Windows PowerShell (WinPE-PowerShell3). Then we updated are boot images on the DP after saving changes.

  5. Thanks, got the components added (once I upgraded to SP1)…still struggling to get this working though…It seems I am now getting an error when it tries to run the OSDAppTree.exe file

    [Failed to run the action: Run OSDAppTree. The specified path is invalid. (Error: 800700A1; Source: Windows)

    (from my smsts.log file)

    …One thing I am little confused is creating the package for OSdAppTree with the .exe,xml and post script file in…I am not sure I udnerstand how to do this…Do I create programs for the 3 seperate items within the package? Or are they source files?

    thanks again

  6. I made sure I added the Microsoft.NET (WinPE-NetFx4) and Windows Powershell (WinPE-PowerShell3) to my boot images but my task sequence still fails during the Convert-OSDAppTreeApps.ps1 step which is right after I run the AppTree. Is there anything else I could be missing? This is with ConfigMgr 2012 R2…

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