Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

CIM · Windows Automation

Direct answer

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.

When to use this

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.

First 30 seconds

1. CIM for inventory and some management.

2. Reuse CimSessions.

3. Filter server-side.

4. Prefer specialised cmdlets when available.

5. Handle access denied.

Operational verification

CIM query/method → WMI provider → result

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Windows and PowerShell automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows and PowerShell automation · Windows Automation → CIM owns CIM-based Windows management automation; application/provider-specific semantics remain with the owning platform feature.
Scope / prerequisiteUse it when designing, operating or troubleshooting Windows Automation behavior around CIM. Keep target scope, executio…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • 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.
Key checks
  • Get-CimInstance Win32_ComputerSystem — inventory
  • Get-CimInstance -CimSession $s Win32_LogicalDisk -Filter 'DriveType=3' — remote disks
  • Invoke-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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows and PowerShell automation current

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%
Terminology layer

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.

Aliases that resolve here
cim automationwindows cim automationcimsession automation
Embedded reference data

Quick lookup tables

CIM automation proof-boundary map

Fast scope, execution, platform-state and workload-acceptance boundaries for CIM.

BoundaryHealthy evidenceSuspicious evidence
Scope / identityExact source revision, hosts and execution identity are explicitSelector drift, stale inventory or wrong token changes scope/authority
OperationTool/provider action and per-host result are traceablePartial failure, hidden error semantics or environment differences are lost
Platform statePersistent and effective state are read backCommand/cmdlet success is mistaken for convergence
Workload proofOriginal service/application acceptance passesAutomation summary substitutes for actual runtime behavior
Confirmation

Confirm action

Continue?