Use this when configuring WinRM for remoting.
WinRM · PowerShell Automation
client → 5985/5986 → WinRM service → PowerShell
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Use winrm enumerate winrm/config/listener, Get-Service WinRM and Test-WSMan to show service/listener/WSMan reachability, then establish the actual PowerShell session and run a read-only command. Verify DNS/SPN/authentication context when Kerberos is expected. A listener test is intermediate evidence; command authorization and target-state verification remain separate.
Step 2 Common mistakes Narrow the fault
- HTTP (5985) on untrusted networks.
Step 3 Where it fails Narrow the fault
Open TCP 5985/5986 is not evidence of usable remoting. Listener presence, authentication, endpoint ACLs and second-hop access can fail independently. Do not solve authentication design by disabling checks globally; identify the failing trust or delegation boundary and validate the minimal correction.
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.
winrm enumerate winrm/config/listener— listenersTest-NetConnection <host> -Port 5985— HTTP portwinrm get winrm/config/service— service settings
ReferenceWhy it matters1 section · depth on demand
In depth
WinRM is the transport behind PowerShell Remoting. For automation at scale, its configuration — listeners, authentication, limits and firewall — decides whether remote jobs are reliable and secure.
winrm get winrm/config/service
winrm enumerate winrm/config/listener
Get-Item WSMan:\localhost\Shell\MaxShellsPerUser
Test-NetConnection srv01 -Port 5986
# HTTPS listener with a certificate
New-Item -Path WSMan:\localhost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $thumb -Force
| Common error | Usual cause |
|---|---|
| "WinRM cannot complete the operation" | Service stopped, firewall, wrong port |
| Access denied | Account not in Administrators/Remote Management Users |
| Kerberos error with IP address | Use the hostname, or HTTPS + explicit credentials |
| Second-hop access denied | Credential delegation (use JEA, resource-based constrained delegation) |
Configure WinRM via Group Policy so every server has the same listeners and firewall rules.
ReferenceImportant terms & boundaries1 section · depth on demand
PowerShell mechanics
On Windows, PowerShell remoting commonly uses WS-Management through the WinRM service and configured listeners. The path includes name resolution/network reachability, listener binding, TLS or HTTP policy, authentication such as Kerberos/NTLM/certificate mechanisms, WinRM service policy and the PowerShell session endpoint. TrustedHosts changes client trust behavior for certain non-Kerberos scenarios and should not be treated as a general authorization control.
ReferenceConfiguration & state1 section · depth on demand
Authoring and lifecycle
Manage listeners, firewall rules and authentication settings as security-sensitive configuration. Prefer Kerberos in a domain context or HTTPS/SSH according to design requirements rather than broad TrustedHosts entries. Record whether configuration is local policy, Group Policy or remoting endpoint configuration, because generated/effective settings can be overwritten by higher-precedence policy.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Review target identity, permissions and environment before mutation.
Enable-PSRemoting -Force
Get-PSSessionConfiguration | Select-Object Name,PermissionVerification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Microsoft Learn documentation reviewed for bounded PowerShell reference claims. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote_requirements?view=powershell-7.5 · confidence 94%Quick lookup tables
WinRM · PowerShell operational reference
Topic-specific PowerShell runtime identity, persistence, verification, output and failure-boundary lookup.
| Boundary | WinRM reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate engine/binding from transport/API/native and target-state failures |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Test-WSMan shows a WS-Management responder, not that the requested PowerShell endpoint or identity can execute the required command. HTTP transport may still be protected by message-level authentication/encryption depending on auth mechanism, but HTTPS changes server identity/transport properties. Capture WinRM error codes and endpoint context rather than relying only on the final localized error string.