Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

WinRM · PowerShell Automation

Direct answer

WinRM is the Windows service behind PowerShell Remoting, listening on 5985 for HTTP and 5986 for HTTPS. Enable it with Enable-PSRemoting and restrict access with firewall rules and TrustedHosts only when needed.

When to use this

Use this when configuring WinRM for remoting.

First 30 seconds

1. WinRM: WS-Management on 5985 (HTTP) / 5986 (HTTPS).

2. HTTP is encrypted by Kerberos/NTLM at message level in domains; use HTTPS elsewhere.

3. Firewall to admin sources only.

4. Configure via GPO.

5. Disable Basic auth.

Operational verification

client → 5985/5986 → WinRM service → PowerShell

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Windows / PowerShell remoting
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 / PowerShell remoting · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when configuring WinRM for remoting.
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.

3 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 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 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
  • WinRM listens on 5985 (HTTP) and 5986 (HTTPS).
  • Enable-PSRemoting configures it.
  • TrustedHosts is needed outside a domain without HTTPS.
Key checks
  • winrm enumerate winrm/config/listener — listeners
  • Test-NetConnection <host> -Port 5985 — HTTP port
  • winrm 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 errorUsual cause
"WinRM cannot complete the operation"Service stopped, firewall, wrong port
Access deniedAccount not in Administrators/Remote Management Users
Kerberos error with IP addressUse the hostname, or HTTPS + explicit credentials
Second-hop access deniedCredential 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Windows / PowerShell remoting 7.5/currentMinimal authored PowerShell pattern for WinRM

Assumptions: Review target identity, permissions and environment before mutation.

Enable-PSRemoting -Force
Get-PSSessionConfiguration | Select-Object Name,Permission
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 / PowerShell remoting 7.5/current

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%
Embedded reference data

Quick lookup tables

WinRM · PowerShell operational reference

Topic-specific PowerShell runtime identity, persistence, verification, output and failure-boundary lookup.

BoundaryWinRM reference
Runtime identityPowerShell edition/version + command/module source
Persistent intentScript/module/config prerequisites under source control
VerificationRead-only discovery → execution evidence → independent target read-back
Output contractStructured objects/streams before formatting
Failure boundarySeparate engine/binding from transport/API/native and target-state failures
Depth when you need it

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.

Confirmation

Confirm action

Continue?