The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Epiphany in Advent

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tim Sneath

Posts: 395
Nickname: timsneath
Registered: Aug, 2003

Tim Sneath is a .NET developer for Microsoft in the UK.
Epiphany in Advent Posted: Dec 16, 2003 4:17 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Tim Sneath.
Original Post: Epiphany in Advent
Feed Title: Tim Sneath's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/tims/Rss.aspx
Feed Description: Random mumblings on Microsoft, .NET, and other topics.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Tim Sneath
Latest Posts From Tim Sneath's Blog

Advertisement

I've had something of an epiphany about Windows Management Instrumentation today. I always used to think that WMI was one of those dreary but worthy things that only systems administrators used to be interested in. A big improvement on SNMP for remotely configuring a file server, sure, but of limited interest to developers?

I've just discovered two things that have finally caused my dull head to see the light. Firstly, I came across the TechNet script centre: a fantastic pot pourri of ready-rolled VBScript fragments that enable you to do everything from creating file shares to finding out what software is installed on a particular machine. This resource is a boon to systems administrators, but it also demonstrates what WMI is capable of in the right hands. Unfortunately there's no language filter that provides you with a C# alternative.

But then I made my second discovery - in this case a re-discovery of something I last came across nearly two years ago. On the .NET WMI page, I found an add-in for the Visual Studio Server Explorer that exposes almost every WMI object on a local or remote system as nicely wrapped .NET classes.

Here are a couple of random examples of the kind of thing you can do with these classes:

   computerSystem.JoinDomainOrWorkgroup();
   string manufacturer = computerSystem.Manufacturer;
   int numProcs = computerSystem.NumberOfProcessors;
   int clockSpeed = processor1.MaxClockSpeed();

I'm always being asked how to access some or other hardware or software setting from .NET managed classes. Usually the answer is some really grungy interop into Win32, but now I've got an alternative story.

Am I the only one to have missed out on all this?

Read: Epiphany in Advent

Topic: The Elements of UML Style Previous Topic   Next Topic Topic: You know you've spent too much time in VS.NET when..

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use