The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,769 other followers

Archive for April 25th, 2009

.NET/C# – obtaining information through WMI

Posted by jpluimers on 2009/04/25

WMI (Windows Management Instrumentation) is a way of obtaining information from your PC that otherwise might be hard to find.
WMI is based on Common Information Model (CIM), so you’ll see an example of that too.

There is one drawback: for a lot of the WMI, you need to have enough privileges (like: being an admin, which none of you should be, right?).
So beware!

You can use WMI from C#, but you have to generate the C# classes for the WMI classes first.

I’ll show some examples for WMI Win32 classes, as I needed some of those classes recently myself.

Before I forget:
in order to browse through the WMI Win32 object instances, you can download this nifty WMI Administrative Tools toolset from the Microsoft MSDN site. Note that these are from 2002, and they only reliably work from within Internet Explorer.
Read the rest of this entry »

Posted in .NET, C#, Development, Software Development, Visual Studio and tools | Leave a Comment »

 
%d bloggers like this: