Showing Dependent Applications in ConfigMgr 2012 via PowerShell

ShowApplDepeThis week I want to devote a blog post to finding dependent applications. Via the ConfigMgr Console it’s very easy to find the configured Dependencies of an Application, but what if I want to know which applications depend on a specific Application? Via the ConfigMgr Console this is not possible (out-of-the-box), but this doesn’t mean that the information is not accessible. In this blog post I will show where to find this information and I will show a complete script which will show the results in a nice form.

Solution

In WMI there is the class SMS_AppDependenceRelation. This class doesn’t contain any methods, but does contain a few interesting properties. These interesting properties are FromApplicationCIID, FromDeploymentTypeCIID, ToApplicationCIID and ToDeploymentTypeCIID. The properties mainly speak for themselves, they contain the CI IDs of the Applications and Deployment Types that depend on each other. The ConfigMgr Console shows the From-To relations and, in this post, I’m searching for the To-From relations. So to get the Applications that depend on a specific Application(CIID), I use the following code snippet:

$DependentApplications = Get-WmiObject -Class SMS_AppDependenceRelation ` -Namespace root/SMS/site_$($SiteCode) -ComputerName $SiteServer ` -Filter "ToApplicationCIID='$ApplicationCIID'"

Now that I know where to get the information, I need to be able to translate it to something readable. For that I will use the class SMS_ApplicationLatest for the Applications and the class SMS_DeploymentType for the Deployment Types and, in both cases, I locate the property LocalizedDisplayName to get a readable name. So to get, for example, the Application name, I use the following code snippet:

$ApplicationName = (Get-WmiObject -Class SMS_ApplicationLatest ` -Namespace root/SMS/site_$($SiteCode) -ComputerName $SiteServer ` -Filter "CI_ID='$ApplicationCIID'").LocalizedDisplayName

Result

ShowDepeApplv09The complete script will show the results of the dependent Applications in a nice form and is available via the TechNet Galleries. The nice thing about the form is that it can also be used as a right-click action. The usage of the script is with the article on the galleries. Please let me know what you think of the script.

>> Available via download here on the TechNet Galleries! <<

24 thoughts on “Showing Dependent Applications in ConfigMgr 2012 via PowerShell”

  1. Hi, Peter
    Great tips. You’re quite ubiquitous in my google searches now! Ha
    This doesn’t appear to apply so much to SCCM 2016 now. Have the WMI classes and namespace organisation changed? I can’t find the SMS_AppDependenceRelation class or any appropriate classes (with my limited WMI knowledge). Do Microsoft even document this information in a timely and accurate manner?

    Thanks for everything!

    Reply
  2. Hi Peter, I agree with the others, you have good posts! But is this the same as going to the application properties “References” tab?

    Regards,
    Bradd

    Reply
  3. not quiet,.
    The command will list what “App1” have dependency

    App1 ( denpendencies: App2 & App3)

    But what i need is the other way round. Look at App3 and see which app has this as a dependencie

    Reply
  4. Hey Peter,
    thx for this article. But i cannot find the script in the TechNet. I believe the link is invalid. Can you provide me an other way to your script?

    BR Oehler

    Reply
  5. Hi Peter, great script !

    By any chance, is there a version that would output to CSV (or even return a table to default output) ?

    Reply
  6. Hi Peter, perhaps I can email you the file or post some other way ? It keeps removing certain parts when I post.
    Regards, Nicolas

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.