Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Mono .NET framework and WMI

Tags:

.net

mono

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 support?

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

like image 323
TWA Avatar asked Jun 16 '09 19:06

TWA


People also ask

What is Mono .NET framework?

Mono is a software platform designed to allow developers to easily create cross platform applications part of the . NET Foundation. Sponsored by Microsoft, Mono is an open source implementation of Microsoft's . NET Framework based on the ECMA standards for C# and the Common Language Runtime.

What version of .NET does Mono support?

NET Framework 4.7. 2 and Mono 6.6.

Is .NET Core compatible with mono?

NET Core. Core does not support any of the backwards compatibility that Mono has like . NET Framework.

What is mono system?

Mono or monophonic describes a system where all the audio signals are mixed together and routed through a single audio channel. Mono systems can have multiple loudspeakers, and even multiple widely separated loudspeakers.


3 Answers

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.

like image 149
gbjbaanb Avatar answered Oct 05 '22 05:10

gbjbaanb


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.

like image 43
James Hugard Avatar answered Oct 05 '22 03:10

James Hugard


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.

like image 42
Ameer Deen Avatar answered Oct 05 '22 04:10

Ameer Deen