gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 11:16:02 25 4
gpt4 key购买 nike

我正在开发一个 Linux 审计应用程序,除其他外,它必须从 Windows 机器上检索已安装的软件和许可证。该应用程序必须是无代理的。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";

现在我的问题是,如何检索某些应用程序的产品 key ?我知道有时它们存储在注册表项中,我可以通过 WMI 查询它们吗?

编辑:刚刚在网站上发现:

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.

所以看起来 WQL 无法查询注册表项,那我该怎么办?有什么想法吗?

最佳答案

我没有在非 Windows 客户端上使用它的经验,但是有 DBD::WMI .

关于linux - 如何从 Linux 查询 Windows 注册表项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8168146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com