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:
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?