Pcornel
Windows · PowerShell

PowerShell Remoting

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

Back to the Topic

Answer

PowerShell Remoting uses the PowerShell Remoting Protocol (PSRP) to run commands in another PowerShell session. On Windows, WSMan/WinRM is the traditional transport; modern PowerShell also supports SSH remoting. Transport, authentication, endpoint/session configuration and target authorization are separate layers.

Remember

  • Network reachability to a host/port does not prove a PowerShell remoting endpoint is usable.
  • Authentication success does not prove authorization inside the session or on downstream resources.
  • PowerShell 7 and Windows PowerShell can expose different remoting endpoints/configurations.
  • Remote objects are commonly serialized and may not retain live methods.
  • Double-hop/delegation issues are credential-forwarding boundaries, not generic network failures.

First checks

  • Test-WSMan <host> — WinRM reachability
  • $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

Commands

Enter-PSSession -ComputerName <computer>
Opens an interactive PowerShell session on a remote computer.
Invoke-Command -ComputerName <computer> -ScriptBlock { <command> }
Runs a script block on one or more remote computers over PowerShell Remoting (WinRM) and returns the results.

Verify in this order

client → WinRM (5985/5986) → authentication (Kerberos/NTLM/cert) → session on the remote host → command runs

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 → PowerShell Remoting reference map

ItemMeaningEvidence boundary
TransportWSMan/WinRM or SSH pathport reachability alone is insufficient
AuthenticationRemote identity establishmentnot target/downstream authorization
EndpointPowerShell session configurationcan differ by engine/version
RunspaceRemote execution contextmodules/profile/language mode may differ
SerializationReturn-object transportcan remove live methods/type fidelity

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

Confirmation

Confirm action

Continue?