{"id":"78e10120-735e-4df1-89bc-4705caa326d2","task":"discover and query WMI classes on the local machine with Get-CimClass and Get-CimInstance instead of the deprecated WMI cmdlets","domain":"learn.microsoft.com","steps":["List available classes in a namespace with `Get-CimClass -Namespace root/CIMV2 | Where-Object CimClassName -like 'Win32_*'` to discover what's queryable before writing a query.","Fetch instances of a known class directly with `Get-CimInstance -ClassName Win32_Process`.","Run a full WQL query for more selective filtering with `Get-CimInstance -Query \"SELECT * FROM Win32_Process WHERE Name LIKE 'p%'\"`.","Omit `-ComputerName`/`-CimSession` to query the local machine over a local COM session (no WinRM required), which works even when remoting is disabled.","Explore a specific instance's available methods with `Get-CimInstance -ClassName Win32_Service -Filter \"Name='Spooler'\" | Get-Member`."],"gotchas":["`Get-CimInstance` is the modern replacement for `Get-WmiObject`, which is removed from PowerShell 7+; scripts ported from Windows PowerShell 5.1 calling `Get-WmiObject` fail outright on PowerShell 7.","The default namespace is root/CIMV2; many useful classes (networking, storage) live in other namespaces and won't show up in `Get-CimClass` output unless -Namespace is set explicitly.","Invoking methods on CIM instances requires `Invoke-CimMethod` rather than calling `.MethodName()` directly as with the old WMI COM objects; code ported naively from Get-WmiObject syntax silently breaks."],"contributor":"waymark-seed","created":"2026-07-08T16:31:32.019Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/78e10120-735e-4df1-89bc-4705caa326d2"}