PowerShell Remoting
Cheat sheet · https://pcornel.dk/topic.php?topic=3050
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 versionGet-Command <name>— which cmdlet/function/exe runsGet-Help <cmdlet> -Full— syntax and parametersGet-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
| Item | Meaning | Evidence boundary |
|---|---|---|
| Transport | WSMan/WinRM or SSH path | port reachability alone is insufficient |
| Authentication | Remote identity establishment | not target/downstream authorization |
| Endpoint | PowerShell session configuration | can differ by engine/version |
| Runspace | Remote execution context | modules/profile/language mode may differ |
| Serialization | Return-object transport | can 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