Pcornel
Windows · Remote Access

WinRM

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

Back to the Topic

Answer

WinRM is Microsoft's WS-Management service used by PowerShell Remoting, listening on 5985 (HTTP) and 5986 (HTTPS). Configure it with winrm quickconfig and check it with Test-WSMan.

Remember

  • WinRM listens on 5985 (HTTP) and 5986 (HTTPS).
  • Outside a domain, TrustedHosts or HTTPS is needed.
  • The HTTPS listener needs a certificate.

First checks

  • Test-NetConnection <host> -Port 3389 — RDP port
  • Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections — RDP enabled (0)
  • Test-WSMan <host> — WinRM
  • Get-Service sshd — OpenSSH server

Verify in this order

WinRM service → listener → firewall → auth

Where it usually breaks

First mismatch in host/interface identity → local config/routing/name state → Windows service/provider → firewall/security/session → remote service → application-visible exchange; preserve identity/native error/pre-state before mutation.

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

Confirmation

Confirm action

Continue?