Correlate Installed Software To Software Center via WMI

1.4k Views Asked by At

I am a bit stumped here hoping someone can help me out. I am trying to collect a list of installed software on the machine (including software that might have been manually installed) and when the user selects what they would like to remove as part of that removal I want to query Software Center to see if it is in there to remove from there first before trying to run the UninstallString from the registry.

These queries get me the data I need for both what is installed on the machine and what is available in Software Center, however I can't seem to find something that correlates the 2 as the Name (Full, Display, Product, etc. variants) as in my environment the names listed in Software Center don't always match what is actually installed and put into A/R Programs.

Any ideas how I can connect what is installed to what is listed in Software Center?

Software Center: Get-WmiObject -ComputerName $Machine -ClassName CCM_Application -Namespace "root\ccm\clientSDK"

Installed Software: Get-WmiObject -ComputerName $Machine -Namespace "root\cimv2\sms" -Class SMS_InstalledSoftware

Edit: To clarify, I need to somehow allow the user to select software installed on the machine, then based on that selection (if it is present) trigger the uninstall method for that same software from Software Center. The difficult part here is that the names are different so especially for things such a SQL or apps with similar names I need something to definitively select the right thing to trigger a removal for in Software Center.

0

There are 0 best solutions below