Mono .NET 框架和 WMI
我们有一个使用 WMI 的 .NET 项目,并且有兴趣将其移植到 Mono 框架。
Mono 似乎不支持 WMI。
有没有可以添加 WMI 支持的库?
基本上我们希望从 Linux/OS X 机器使用 WMI 访问 Windows 服务器。
We have a .NET project that uses WMI and are interested in porting it to the Mono framework.
It appears Mono does not support WMI.
Are there any libraries that can add WMI support?
Basically we would want to access a Windows server using WMI from a Linux/OS X box.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Windows Management Instrumentation 是 WBEM (基于 Web 的企业管理) 的 Microsoft 实现。
有一些开源实现(例如 openPegasus)您可能可以使用客户端,但没有告诉您MS 对他们的版本做了什么。 如果您可以向服务器发送 CIM 查询,那么您可能会得到好的结果。
请注意,Windows 不通过 http 执行 WMI,仅执行 DCOM/DCE-RPC,因此某些客户端将无法工作。 快速 google.. 和 OpenPegasus 将允许您使用 WMI 映射器访问 Windows 。 如果没有,您始终可以在 Windows 上运行服务器组件。
Windows Management Instrumentation is a Microsoft implementation of WBEM (Web-Based Enterprise Management).
There are open-source implementations (eg openPegasus) that you might be able to use a client, but there's no telling what MS did with their version. If you can send CIM queries to the server, then you may get good results.
Note that Windows doesn't do WMI over http, only DCOM/DCE-RPC, so some clients will just not work. A quick google.. and OpenPegasus will allow you to access Windows using a WMI Mapper. If not, you could always run the server component on Windows.
关于 WMI over HTTP,请查看 WinRM ,这似乎是针对 XP、Win2003、Win2008 和远景。 这定义了一种通过 HTTP(S) 访问通用信息模型 (CIM) 信息的方法(肥皂)。 CIM 由 DMTF 定义,WMI 是 Microsoft 对 CIM 的实现。
如果我没看错的话,您应该能够在 Linux 上使用 SOAP 访问 Windows 计算机上的 WinRM (WS-Management),从而提供对 WMI 的访问(只要 WinRM 已安装、正在运行且未设置防火墙)。
IT/安全是否允许在企业网络上运行这样的东西完全是另一回事:任何开放端口都可能存在安全风险,而允许命令、控制和设计配置的端口可能是一个很大的漏洞。 证书、IPSec 和范围防火墙规则是您的朋友!
请注意,我没有使用 WS-Management 或 WinRM 的直接经验,因此 YMMV 。
Regarding WMI over HTTP, take a look at WinRM, which appears to be an implementation of WS-Management for XP, Win2003, Win2008, and Vista. This defines a way to access Common Information Model (CIM) information over HTTP(S) (SOAP). CIM is defined by the DMTF and WMI is Microsoft's implementation of CIM.
If I read the alphabet soup correctly, you should be able to use SOAP from Linux to access WinRM (WS-Management) on a Windows machine, thus providing access to WMI (as long as WinRM is installed, running, and not firewalled).
Whether running such a thing on a corporate network will be allowed by IT/Security is another matter entierely: any open port can be a security risk and one which allows command, control, and configuration by design can be quite a hole. Certificates, IPSec, and scoped firewall rules are your friend!
Note that I have no direct experience using WS-Management, nor WinRM, so YMMV.
我知道你可以在 Linux 上安装 wmi-client (sudo apt-get install wmi-client)。 您应该能够使用它从 Linux 命令行查询 Windows 机器上的任何 wmi 对象。
I know you can install wmi-client on Linux (sudo apt-get install wmi-client). You should be able to query any wmi object on a Windows box from the Linux command line using this.