Pcornel
Windows · Remote Access

PowerShell Remoting

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

Back to the Topic

Answer

PowerShell Remoting runs commands on remote computers over WinRM or SSH with Enter-PSSession for interactive sessions and Invoke-Command for one or many machines. Enable it with Enable-PSRemoting.

Remember

  • Remoting runs over WinRM, or over SSH in PowerShell 7.
  • Kerberos is used inside a domain.
  • The double-hop problem blocks access to a third server.

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

client → WinRM → auth → session config → command

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=3121

Confirmation

Confirm action

Continue?