Pcornel
Windows · PowerShell

WinRM

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

Back to the Topic

Answer

WinRM is the Windows implementation of WS-Management and provides a management transport used by Windows PowerShell remoting and other clients. A WinRM listener/service can be healthy while a PowerShell endpoint, authentication method or authorization policy still prevents a PSRP session.

Remember

  • WinRM service/listener health is a lower boundary than PowerShell endpoint health.
  • HTTP/HTTPS WinRM listeners define transport exposure; authentication and session authorization remain separate.
  • Firewall/network reachability can block transport before PowerShell is involved.
  • TrustedHosts is not a general “fix remoting” switch; it changes trust behavior and must be scoped intentionally.
  • Test-WSMan-style success proves WSMan response, not successful PowerShell command execution.

First checks

  • winrm enumerate winrm/config/listener — listeners
  • $PSVersionTable — PowerShell edition and version
  • Get-Command <name> — which cmdlet/function/exe runs
  • Get-Help <cmdlet> -Full — syntax and parameters
  • Get-ExecutionPolicy -List — execution policy per scope

Verify in this order

WinRM service → listener on 5985/5986 → firewall → authentication → PowerShell endpoint

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

PowerShell → WinRM reference map

ItemMeaningEvidence boundary
Network pathReach listener address/portnot proof WinRM application response
ListenerWSMan transport bindingnot proof authentication/endpoint
WinRM serviceWSMan implementationnot proof PSRP session config
Authentication/trustIdentity boundarynot proof remote command authorization
PowerShell endpointRunspace/session configseparate from listener existence

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

Confirmation

Confirm action

Continue?