[英]How can I query Windows registry keys from Linux?
I am developing a Linux auditing application that, among other things, has to retrieve installed software and licenses from a Windows machine. 我正在开发一个Linux审计应用程序,除其他外,它必须从Windows机器检索已安装的软件和许可证。 The application MUST be agent-free.
该应用程序必须是免代理的。 wmi-client actually does implement what I want, I tryed to query applications and it worked just fine:
wmi-client实际上实现了我想要的东西,我试着查询应用程序,它运行得很好:
# 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?
我知道有时它们存储在注册表项中,我可以通过WMI查询吗?
EDIT: Just found that on a website: 编辑:刚刚在网站上发现:
http://social.technet.microsoft.com/Forums/en/winserverGP/thread/5cd1b80a-2f90-4d46-bf65-dba52dcf0c56 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.
WQL查询基于某些提供一组属性的WMI类。 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.
相反,WMI注册表操作基于“默认”命名空间中的“StdRegProv”,并且必须调用某些方法才能获得结果。 That means a registry query bases WMI filter is not possible.
这意味着基于WMI过滤器的注册表查询是不可能的。
So it looks like WQL cannot interrogate Registry Keys, what can I do then? 所以看起来WQL无法查询注册表项,那我该怎么办? Any ideas?
有任何想法吗?
我没有在非Windows客户端上使用它的经验,但有DBD :: WMI 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.