Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Computer Software Inventory with WMI and PowerShell

24 views
Skip to first unread message

chrie

unread,
Dec 3, 2009, 9:48:09 AM12/3/09
to
Hello NG!

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

Dave Sellars

unread,
Dec 4, 2009, 11:56:11 AM12/4/09
to
hello chrie

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.

mayayana

unread,
Dec 4, 2009, 2:23:09 PM12/4/09
to

As you said, the WMI functions are not of much
use. They're just a wrapper around Windows
Installer. In fact you can cut out the middleman
altogether and use the Windows Installer API
if that were all you needed. The W.I. API is more
complete than the WMI wrapper. But it's
hardly worth bothering with any of that since it
will only show you software installed via MSI.
Even though Microsoft has proclaimed MSIs to be
the official way to install software, they're still
not all that common, and MS themselves often
don't even use them.

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.

chrie

unread,
Dec 7, 2009, 1:41:47 AM12/7/09
to
Thanks for the answers.
0 new messages