wmisccm

What WMI class stores Deployment Type installation program on MECM


I need to retreive a data related the MECM Application via WMI classes, more specifically, I need to get Application Deployment Type properties - Installation / Uninstallation programs.

Could you please help me, what exact WMI class can I use to obtain this information.

Thank you for any help.

deployment type props


Solution

  • This is unfortunately not very easy to get information afaik, but with some help from powershell (or any programming language that can access wmi really) it can be done.

    The information itself is stored within the Class SMS_Application in the Property SDMPackageXML.

    Now the first thing you will notice if you query this is it is probably empty. That is because it is a lazy property. To work around this in PS you have to for example call an extra get() on your wmi object.

    If you do this (or have some tool that just shows all lazy parameters anyway) you will notice it is - as suggested by the name - basically an XML document, that stores the information you need deep inside. So you have to extract it from within the XML.

    Some example code on how to do this for a single app would be:

    $app = Get-WmiObject -Class SMS_Application -Namespace "root\SMS\site_sitecode" -computer "your site server" -Filter "LocalizedDisplayName='your app name'"
    $app.Get()
    $installCMD = (([xml](($app).SDMPackageXML)).AppMgmtDigest.DeploymentType.Installer.InstallAction.Args.Arg | where {$_.Name -ieq "InstallCommandLine"}).'#text'
    $uninstallCMD = (([xml](($app).SDMPackageXML)).AppMgmtDigest.DeploymentType.Installer.InstallAction.Args.Arg | where {$_.Name -ieq "UninstallCommandLine"}).'#text'
    

    I'm not great with xml parsing so there might be a better way to do it or maybe you don't need the parsing but can just string compare the xml digest. Just start by looking at a SDMPackageXML and then you will probably see how to best analyze it for your own needs.