Foundations
WMI & CIM
The management instrumentation layer behind most admin scripts — querying live system state without a bespoke API for every question.
Diagnostics & logging named WMI as answering a different question than Event Log or ETW: not "what happened," but "what is the current state of this system, right now." This chapter is about how that instrumentation layer is actually organized.
Classes and instances: a general-purpose object model for system state
Rather than exposing a separate, purpose-built API for every conceivable piece of system information — one API for querying processes, a different one for services, another for disk configuration — WMI (Windows Management Instrumentation) exposes a general, queryable object model: classes describe a category of manageable object (Win32_Process, Win32_Service, Win32_LogicalDisk, and hundreds of others), and instances represent the actual, live (or static configuration) objects of that class currently present on the system. A single, consistent query mechanism — rather than a proliferation of narrow, bespoke APIs — can then be used to ask about essentially any of them.
CIM (Common Information Model) is the schema standard modern WMI access is built around — a standardized way of describing classes, their properties, and their relationships, shared with broader industry management standards rather than being an entirely Windows-specific invention.
Providers, again — a familiar pattern, different purpose
WMI has its own notion of providers, conceptually related to but distinct from the event-log providers covered earlier in this track: a WMI provider supplies the classes and answers the queries for a specific area of system state — routing a query about running processes to whichever provider actually knows how to enumerate them, for instance. WMI infrastructure handles routing an incoming query to the right provider (which might be a simple in-process component, or something reaching further down into kernel-level state) transparently to the caller.
Not just for querying — subscriptions too
Beyond point-in-time queries, WMI supports event consumers: subscriptions that let a script or tool be notified when something specific happens (a process starts, a service changes state) rather than having to poll repeatedly. This blurs slightly into ETW's territory conceptually, but WMI's event model is generally coarser-grained and oriented toward management-relevant occurrences, not the high-frequency, fine-detail tracing ETW is built for.
A worked example: Get-CimInstance Win32_Process in PowerShell
A PowerShell script calling Get-CimInstance Win32_Process is, underneath, issuing a WMI query against the Win32_Process class — the same general-purpose querying mechanism this chapter describes, wrapped in a friendlier, more modern PowerShell-native calling convention (Get-CimInstance is the current, WS-Management-based successor to the older, legacy wmic command-line tool and the older Get-WmiObject cmdlet). This is exactly why inventory scripts, triage tooling, and enterprise management software so consistently lean on WMI/CIM queries: one consistent mechanism, applicable to processes, services, disks, and a very large catalog of other manageable system aspects, without needing a different API for each one.
A common mistake
Confusing WMI with the Event Log — or assuming "WMI events" means the same thing as "Event Log records" — misreads what WMI is actually for. WMI can surface notifications through its own event-consumer mechanism, but it's fundamentally a broader management and instrumentation stack, oriented around querying and acting on current or configured system state, not a logging or history mechanism in the sense Event Log or ETW are.
Where this connects
- Diagnostics & logging covers how WMI relates to, and differs from, the other two diagnostic mechanisms in this cross-cutting track.
- Services & background infrastructure and Processes & threads are both frequent, representative targets of exactly the kind of WMI queries this chapter describes.