Use it when designing, operating or troubleshooting Windows Automation behavior around CIM. Keep target scope, execution context, operation result, platform read-back and workload acceptance as separate proof boundaries.
CIM · Windows Automation
CIM Automation queries and changes Windows management objects through CIM providers/sessions while preserving namespace/class/schema, target/session, property/method semantics and resulting OS state.
1. CIM for inventory and some management.
2. Reuse CimSessions.
3. Filter server-side.
4. Prefer specialised cmdlets when available.
5. Handle access denied.
CIM query/method → WMI provider → result
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 Operational evidence path Verify boundary
target/session → namespace/class → instance selection → property/method request → provider result → refreshed CIM read-back → Windows/service acceptance
Healthy evidence: namespace/class/instance and session context are explicit, provider results are captured and fresh read-back plus workload checks align.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: schema or provider differences, stale objects or broad instance selectors make successful calls affect the wrong or incomplete target state.
CIM provider results establish management-object observations only and do not show application-level behavior.
Step 3 Common mistakes Narrow the fault
- Using DCOM-based WMI through firewalls.
Step 4 Where it fails Narrow the fault
Trace a failure along the path it takes: script/command → PowerShell runtime → remoting/CIM/WinRM/API → Windows subsystem → persisted/runtime state → independent read-back. Find the first step where the actual state differs from what you expected.
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.
- CIM session created ≠ requested namespace/class authorized.
- Class exists ≠ property/method supported as assumed.
- Method return success ≠ downstream service/workload healthy.
- CIM object snapshot ≠ current state forever.
Get-CimInstance Win32_ComputerSystem— inventoryGet-CimInstance -CimSession $s Win32_LogicalDisk -Filter 'DriveType=3'— remote disksInvoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine='cmd /c echo'}— method call
ReferenceWhat it is1 section · depth on demand
Core model
Resolve target/session and CIM namespace/class first, then instance selection, property/method operation, provider response and independent Windows state read-back.
ReferenceWhy it matters1 section · depth on demand
Worked example
CIM (Common Information Model) is the standard management model that Windows exposes through WMI classes. The CIM cmdlets query and change these classes locally and remotely over WinRM, making them the standard way to collect inventory and manage settings across Windows servers.
Worked example — inventory of OS, uptime and disk space across servers:
$s = New-CimSession -ComputerName (Get-Content servers.txt)
$os = Get-CimInstance -CimSession $s Win32_OperatingSystem
$disk = Get-CimInstance -CimSession $s Win32_LogicalDisk -Filter "DeviceID='C:'"
$os | ForEach-Object {
$d = $disk | Where-Object PSComputerName -eq $_.PSComputerName
[pscustomobject]@{
Server = $_.PSComputerName; OS = $_.Caption
UptimeDays = [int]((Get-Date) - $_.LastBootUpTime).TotalDays
FreeGB_C = [math]::Round($d.FreeSpace/1GB,1)
}
} | Export-Csv inventory.csv -NoTypeInformation
Remove-CimSession $s
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
CIM provider results establish management-object observations only and do not show application-level behavior.
Mechanics
Windows Automation → CIM is owned at runtime by the PowerShell/Windows management runtime, remoting/CIM/Task Scheduler/service APIs and the Windows target subsystem. Follow the chain of components script/command → PowerShell runtime → remoting/CIM/WinRM/API → Windows subsystem → persisted/runtime state → independent read-back and record which layer currently owns truth.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Windows Automation > CIM. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
CIM automation proof-boundary map
Fast scope, execution, platform-state and workload-acceptance boundaries for CIM.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Scope / identity | Exact source revision, hosts and execution identity are explicit | Selector drift, stale inventory or wrong token changes scope/authority |
| Operation | Tool/provider action and per-host result are traceable | Partial failure, hidden error semantics or environment differences are lost |
| Platform state | Persistent and effective state are read back | Command/cmdlet success is mistaken for convergence |
| Workload proof | Original service/application acceptance passes | Automation summary substitutes for actual runtime behavior |