IT Management Using C# with WMI
Managing any technology entity requires data. An entity can be anything from an email message to the biggest of servers. You need data about an entity in order to make decisions; for example, before you reply to an email you usually read it. On the other hand, if an incoming email is spam, if it hasn’t been screened, you just delete it.
Drawing Data from an Entity
The central issue with IT management is the process of drawing data from a managed entity, making a decision based on that data, and then taking some appropriate action. The latter action may in fact be executed by software or a person. This is the proactive version—but there is another approach, in which the managed entity contains software that informs you when some action is required. An example of this is automatic network congestion detection, which occurs when software monitors a network and raises an alarm when utilization goes above a certain level.
Management actions in this case might be to reroute traffic or to add more bandwidth. Management is all about data, and you are in some sense managing it every single time you interact with a computing element.
The Windows platform supports a number of mechanisms for acquiring management data and one of them is Windows Management Instrumentation (WMI): the topic of this article. I’ll show you how simple and straightforward it is to draw data from the .NET platform and then (if necessary) make some decisions based on that data.