Pcornel
Automation · Windows Automation

CIM

Cheat sheet · https://pcornel.dk/topic.php?topic=5667

Back to the Topic

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.

Remember

  • 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.

First 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

Verify in this order

CIM query/method → WMI provider → result

Where it usually breaks

CIM provider results establish management-object observations only and do not prove application-level behavior.

Commit/input → runner/job → build/test artifact → deployment request → target rollout/reconcile → effective version/config → health/readiness → workload.

CIM automation proof-boundary map

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5667

Confirmation

Confirm action

Continue?