简体   繁体   English

如何从Linux查询Windows注册表项?

[英]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.

相关问题 如何从Linux上的Windows注册表中检索区域设置? - How to retrieve regional settings from a Windows registry on Linux? 在Linux下编辑Windows注册表 - Editing Windows registry, from Python, Under Linux 如何从Windows反编译Linux二进制文件? - How can I decompile Linux binaries from Windows? Windows下用于密钥的Randomnumbergenerator-从Linux移植 - Randomnumbergenerator for Keys under Windows - ported from Linux 如何在 Linux 中添加具有不同 SSH 密钥的用户? - How can I add users with different SSH keys in Linux? 如何将Eclipse中的libgdx项目从Windows移植到Linux,反之亦然? - How can I transfter a libgdx project in eclipse from windows to linux and vice versa? 如何从Windows笔记本电脑舒适地设计基于Linux的终端应用程序? - How can I comfortably design a Linux based terminal application from my Windows laptop? 如何从我的 Windows 机器运行安装在 linux 机器上的 OpenGL 应用程序? - How can I run an OpenGL application installed on a linux machine from my windows machine? 如何使用Windows 7中的远程桌面连接到Amazon Linux实例? - How Can I connect to Amazon Linux instance using Remote Desktop from Windows 7? 如何从 windows 主机访问我的设备到 docker linux 容器? - How can I access my device from a windows host to a docker linux container?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM