Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

PowerShell Remoting · Remote Access

Direct 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.

When to use this

Use this when running commands on remote Windows machines with PowerShell.

First 30 seconds

1. Test-WSMan <host>.

2. Invoke-Command -ComputerName <host> { hostname }.

3. Access denied → Remote Management Users / admin.

4. Workgroup → HTTPS or TrustedHosts.

5. JEA endpoints for least privilege.

Operational verification

client → WinRM → auth → session config → command

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Windows networking and network services
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows networking and network services
Scope / prerequisiteUse this when running commands on remote Windows machines with PowerShell.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Adding * to TrustedHosts to make NTLM work.
  • Using CredSSP everywhere to solve the second hop (exposes credentials).
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • 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.
Key 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
ReferenceWhy it matters1 section · depth on demand

How it works

PowerShell Remoting uses WinRM (WS-Management) over HTTP 5985 or HTTPS 5986. Enable-PSRemoting starts WinRM, creates listeners and firewall rules. In a domain, Kerberos authenticates and encrypts the session even over HTTP. Commands run on the remote machine in a session endpoint (Microsoft.PowerShell by default; JEA endpoints restrict what users can run). Credentials are not passed on, which causes the second hop problem.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

The second-hop problem, concretely

PS C:\> Invoke-Command -ComputerName srv01 -ScriptBlock { Get-ChildItem \\fs01\share }
Access is denied.

With Kerberos (the default in a domain), srv01 has a ticket for your session on srv01 but no credentials to authenticate to fs01. The command works locally on srv01, and fails only when it reaches a third machine.

Options Microsoft documents, and when to use them

OptionSecurityUse when
Resource-based Kerberos constrained delegationGood — configured on the target (fs01)A defined set of servers needs to reach a defined resource
Kerberos constrained delegationGoodSame, configured on the middle server
JEA endpoint with a virtual or gMSA accountGoodDelegating specific admin tasks
Pass -Credential inside the script blockAcceptable for one-off adminCredentials sent explicitly for the inner call
PSSessionConfiguration with RunAsMediumFixed admin endpoints
CredSSPWeak — full credentials cached on srv01Avoid; only for isolated lab tasks
Unconstrained delegationWeakAvoid

Resource-based constrained delegation example:

$srv01 = Get-ADComputer srv01
Set-ADComputer fs01 -PrincipalsAllowedToDelegateToAccount $srv01
klist purge -li 0x3e7          # on srv01, refresh its tickets

Connection basics worth checking first

CheckCommand
WinRM listeningTest-WSMan srv01
Listener typeswinrm enumerate winrm/config/listener
FirewallTCP 5985 (HTTP) / 5986 (HTTPS)
Authentication usedKerberos needs the name, not the IP; IP or workgroup → NTLM + TrustedHosts or HTTPS

Avoid weakening settings to make it work

Set-Item WSMan:\localhost\Client\TrustedHosts * disables server identity checks for NTLM. Prefer HTTPS listeners with a certificate for non-domain machines, or SSH-based remoting in PowerShell 7 (Enter-PSSession -HostName srv01 -UserName admin).

*The PowerShell remoting second-hop example above are illustrative examples, not captured from a lab or production system.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows networking and network services current

Authoritative/upstream documentation reviewed for bounded claims in Remote Access → PowerShell Remoting. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/ · confidence 94%
Confirmation

Confirm action

Continue?