I need a WMI Class who shows the Installed Software analog to the GUI
view "Add or Remove Programms"
Currently i use this command:
Get-WmiObject Win32_Product | Select Name, Version
however this command shows only installed .msi packages.
I also need a WMI Class for a analog output of the Windows Services.
THX
I think you're out of luck here, I have been trying to achieve the same thing,
and the only way I can find is to enumerate the 'Uninstall' keys in the registry
(under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall) using remote
registry access (through WMI). The problem with this is, you can't find the
install-date, so you have to match the Win32_Product entries and get dates for
the ones that match. For the others, it doesn't seem to be possible :-(
HTH
Dave.
The Uninstall key, as Dave Sellars noted, is
where Add/Remove gets its list. There's also the
App Paths key. Neither key is foolproof because
neither is necessary to install software. For instance,
I have Firefox and K-Meleon installed -- 2 Mozilla
browsers. Neither uses .msi installers. K-Meleon
doesn't register in App Path.
The only standardized method you might use is
to go through the Uninstall key getting anything
with a DisplayName value. But even then there's no
standardization. For instance, the K-Meleon key is
named "K-Meleon", quite sensibly. :) But the DisplayName
string is "K-Meleon 1.5.3 en-US (remove only)". It would
take some parsing to find out what that program is.
Yet the key names are not useful. MSI installs use a
meaningless GUID as key name. Also, Microsoft adds
a lot of useless junk keys like "IEData" that don't
correspond to any installed software and have no data
in the key. So a DisplayName string is the closest
thing to what you want. At least that will give you a
list that matches Add/Remove.