Pcornel
Automation · Windows Automation

WinRM

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

Back to the Topic

Answer

WinRM in Windows Automation provides WS-Management transport for remote management, with listener, certificate/trust, authentication, authorization and endpoint/session configuration as separate proof boundaries.

Remember

  • TCP 5985/5986 reachable ≠ WinRM listener usable.
  • HTTPS listener exists ≠ certificate identity trusted.
  • WinRM authentication ≠ PowerShell endpoint authorization.
  • Test-WSMan success ≠ requested remote command succeeds.

First checks

  • winrm quickconfig — basic setup
  • winrm enumerate winrm/config/listener — listeners
  • Test-NetConnection <host> -Port 5986 — HTTPS listener

Verify in this order

client → WinRM 5985/5986 → host

Where it usually breaks

WinRM transport health does not prove PowerShell/CIM/provider operation or final Windows state.

Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.

WinRM 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=5666

Confirmation

Confirm action

Continue?