Use this when older scripts use WMI cmdlets.
WMI
WMI is the older Windows management interface queried with Get-WmiObject in Windows PowerShell. PowerShell 7 uses the CIM cmdlets instead, which use the same classes over WS-Man.
1. WMI is Windows' management instrumentation.
2. Access via CIM cmdlets.
3. Repository corruption: verify/salvage.
4. WMI event subscriptions are a persistence technique — monitor.
5. DCOM firewall needs.
WMI provider → CIM/WMI query → data
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
On legacy Windows PowerShell, show namespace/class availability and retrieve a read-only instance before attempting methods. Compare a CIM query for the same management object where migrating. Capture provider/namespace, target computer and authentication context because a DCOM transport failure is different from a WMI provider/class failure.
Step 2 Common mistakes Narrow the fault
Get-WmiObjectin PowerShell 7 (removed).
Step 3 Where it fails Narrow the fault
Treat WMI as a legacy Windows-specific compatibility boundary. A script working under Windows PowerShell 5.1 can fail under modern pwsh because command availability changed, even though the target WMI provider still exists. Separate client cmdlet availability, DCOM transport, WMI provider semantics and managed-resource state.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Get-WmiObject exists only in Windows PowerShell.
- Use Get-CimInstance in PowerShell 7.
- The classes are the same.
Get-CimClass -Namespace root/cimv2 | measure— available classeswinmgmt /verifyrepository— repository check- Legacy Get-WmiObject usage — migrate to CIM
ReferenceWhy it matters1 section · depth on demand
In depth
WMI (Windows Management Instrumentation) is the underlying management data model in Windows: classes such as Win32_Service, Win32_Process and MSFT_NetAdapter describe the system. The legacy Get-WmiObject cmdlets use DCOM and are not available in PowerShell 7; the CIM cmdlets access the same classes over WinRM.
Get-CimClass -Namespace root/cimv2 -ClassName Win32_*Network* | Select-Object CimClassName
Get-CimInstance -Namespace root/StandardCimv2 -ClassName MSFT_NetAdapter |
Select-Object Name, InterfaceDescription, LinkSpeed
WMI is also used for event subscriptions and by attackers for persistence and lateral movement, so monitor WMI activity (event log Microsoft-Windows-WMI-Activity/Operational) and restrict remote WMI access to administration hosts.
ReferenceImportant terms & boundaries1 section · depth on demand
PowerShell mechanics
WMI is the legacy Windows management infrastructure exposed historically in Windows PowerShell through commands such as Get-WmiObject and through COM/.NET APIs. WMI providers expose namespaces, classes, instances and methods, frequently over DCOM for remote access. Modern cross-version PowerShell automation should generally prefer CIM cmdlets where equivalent functionality exists, while recognizing that legacy scripts may still depend on WMI-specific behavior.
ReferenceConfiguration & state1 section · depth on demand
Authoring and lifecycle
When maintaining WMI automation, make Windows PowerShell 5.1 versus PowerShell 7 compatibility explicit because legacy WMI cmdlets are not a portable modern contract. Scope remote DCOM/firewall permissions narrowly, identify the exact namespace/class, and plan migrations to CIM where provider semantics match. Do not mechanically replace APIs without checking method/property differences.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Review target identity, permissions and environment before mutation.
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object CSName,Caption,VersionVerification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Microsoft Learn documentation reviewed for bounded PowerShell reference claims. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/07-working-with-wmi?view=powershell-7.5 · confidence 94%Quick lookup tables
WMI · PowerShell operational reference
Topic-specific PowerShell runtime identity, persistence, verification, output and failure-boundary lookup.
| Boundary | WMI reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate engine/binding from transport/API/native and target-state failures |
Deep reference
Healthy vs suspicious evidence
Output interpretation
WMI formatted output can hide namespace/class identifiers and provider-specific return codes. An RPC/DCOM connection success does not mean the WMI namespace authorizes the requested operation. When comparing WMI and CIM results, align properties and identity keys rather than comparing display tables.