开发者

The Mono .NET framework and WMI

开发者 https://www.devze.com 2023-03-18 23:39 出处:网络
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.

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 sup开发者_C百科port?

Basically we would want to access a Windows server using WMI from a Linux/OS X box.


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号