Chapter 11. Tackling Windows Management Instrumentation
I’ve been looking forward to writing this chapter, and dreading it at the same time. Windows Management Instrumentation (WMI) is probably one of the best things Microsoft has ever offered to administrators. At the same time, it’s also one of the worst things they’ve ever inflicted on us. In this chapter, I’ll be introducing you to WMI, showing you how it works, and explaining some of its less-beautiful aspects, so that there’s full disclosure on what you’re up against.
The idea behind WMI is a good one: it’s a generic system for retrieving management information. In some limited cases it can also be used for implementing configuration changes, although, for the most part, Microsoft hasn’t leveraged that well or consistently.
WMI is built primarily around a system of providers, and each provider is designed to expose a particular type of management information. For example, on Windows Server, when you install the DNS Server role, you also install the bits that make DNS accessible through WMI, enabling you to query DNS records. Windows has a number of providers that install by default and provide information about the core operating system and computer hardware. Each computer can have a completely different set of WMI providers, because each computer on your network will have different software installed.