3

I am developing a Linux auditing application that, among other things, has to retrieve installed software and licenses from a Windows machine. The application MUST be agent-free. wmi-client actually does implement what I want, I tryed to query applications and it worked just fine:

# LAUNCHING WMIC PLUGIN 
my $cmd = "wmic -U ".$username."%".$password." //".$hostname." \"select Name, Version from Win32_Product\"";
my $output = `$cmd`;
print "INSTALLED SOFTWARE:\n";  
print "$output";

Now my question is, how can I retrieve the Product Key for certain applications? I know that sometimes they are stored in the Registry Key, can I query them through WMI?

EDIT: Just found that on a website:

http://social.technet.microsoft.com/Forums/en/winserverGP/thread/5cd1b80a-2f90-4d46-bf65-dba52dcf0c56

WQL queries are based on certain WMI classes which offer a set of properties. The WMI registry actions instead are based on the "StdRegProv" in the "Default" namespace and certain methods have to be called to get a result. That means a registry query bases WMI filter is not possible.

So it looks like WQL cannot interrogate Registry Keys, what can I do then? Any ideas?

raz3r
  • 3,071
  • 8
  • 44
  • 66

1 Answers1

1

I do not have any experience using it on non-Windows clients, but there is DBD::WMI.

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
  • As far as I know it uses WMI queries in order to gather informations. Registry key cannot be queried through WMI though. – raz3r Nov 21 '11 at 10:02
  • That module seems to use use Win32::WQL; which I think makes it windows only. – Wil Aug 30 '12 at 10:56