Configure WinRM over HTTPS with a Trusted Certificate
Before you begin
- Applies to:WinRM over HTTPS using an organization-trusted server certificate.
- Where to start:Start on the Windows server that will host the HTTPS listener. Keep a separate approved management path available.
- What you need:Have a valid certificate in Local Computer → Personal with the server FQDN in its subject alternative name, the Server Authentication purpose, and its private key.
Guide tools
Windows Remote Management (WinRM) supports PowerShell remoting over HTTP or HTTPS. With Kerberos or NTLM, WinRM protects messages over HTTP; HTTPS adds TLS transport. HTTPS does not replace authentication or prevent pass-the-hash attacks by itself. For domain systems, prefer Kerberos and a server certificate trusted by clients.
This walkthrough uses a certificate issued by your organization’s trusted certificate authority (CA). The certificate must be in the Local Computer\Personal store, include the server’s fully qualified domain name (FQDN) in its Subject Alternative Name, have the Server Authentication purpose, be valid, and include its private key. It does not configure mutual TLS or client-certificate authentication.
Port & Protocol Architecture
| Setting | HTTP Listener | HTTPS Listener |
|---|---|---|
| Listener Port | TCP 5985 (HTTP) | TCP 5986 (HTTPS) |
| Authentication | Depends on configured policy | Kerberos for domain remoting |
| Encryption | Kerberos/NTLM can encrypt WinRM messages | TLS-protected HTTPS transport |
| Certificate | Not used for HTTP transport | Trusted server certificate matching the FQDN |
Record Listener State and Identify a Trusted Certificate
PrerequisitesRun these checks in an elevated PowerShell session on the server. Obtain or enroll a certificate from your organization’s CA if none is suitable. Do not use a self-signed certificate for a production listener or bypass certificate validation on clients.
$Fqdn = 'srv01.corp.internal'winrm enumerate winrm/config/listenerGet-NetConnectionProfile | Select-Object InterfaceAlias, NetworkCategoryGet-ChildItem Cert:\LocalMachine\My | Where-Object { $_.HasPrivateKey -and $_.NotAfter -gt (Get-Date) } | Select-Object Subject, DnsNameList, EnhancedKeyUsageList, Thumbprint, NotAfter❯ Illustrative Output (Results Vary)
Select the certificate whose DNS name matches srv01.corp.internal,whose chain is trusted by clients, and whose Enhanced Key Usage includesServer Authentication. Record its thumbprint for the next step.Bind the Certificate to Port 5986
Listener SetupSet $CertificateThumbprint to the verified certificate thumbprint. Confirm the management interface’s network profile and set $FirewallProfile to that profile. Start WinRM and create the HTTPS listener first; allow port 5986 only from the approved management subnet. Keep the existing HTTP listener in place until HTTPS has been tested successfully. If an HTTPS listener already exists, inspect and update it through your change process instead of creating a duplicate.
$CertificateThumbprint = '<verified-certificate-thumbprint>'$ManagementSubnet = '10.10.100.0/24'$FirewallProfile = 'Domain'
# Change the profile value if the management interface is not on Domain.Set-Service -Name WinRM -StartupType AutomaticStart-Service -Name WinRM
New-WSManInstance -ResourceURI 'winrm/config/Listener' ` -SelectorSet @{ Address = '*'; Transport = 'HTTPS' } ` -ValueSet @{ Hostname = $Fqdn; CertificateThumbprint = $CertificateThumbprint }
New-NetFirewallRule ` -Name 'WinRM-HTTPS-5986-Management' ` -DisplayName 'WinRM HTTPS from Management Subnet' ` -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5986 ` -RemoteAddress $ManagementSubnet -Profile $FirewallProfile
winrm enumerate winrm/config/listener❯ Illustrative Output (Results Vary)
Transport: HTTPSPort: 5986Hostname: srv01.corp.internalCertificateThumbprint: <verified certificate thumbprint>Keep WinRM Authentication on Approved Windows Methods
Service PolicyDisable unencrypted WinRM messages and Basic authentication. For a domain member, connect by FQDN with Kerberos so the client authenticates the server and user through the domain. If Group Policy manages WinRM, make the change in the controlling policy instead of relying on local settings.
Set-Item -Path WSMan:\localhost\Service\AllowUnencrypted -Value $falseSet-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $false
Get-Item WSMan:\localhost\Service\AllowUnencryptedGet-Item WSMan:\localhost\Service\Auth\Basic❯ Illustrative Output (Results Vary)
AllowUnencrypted : falseBasic : falseValidate the Certificate and Kerberos Remoting
VerificationRun the checks from an authorized domain management workstation. Use the same FQDN that appears on the certificate. Do not add -SkipCACheck or -SkipCNCheck; a validation failure means the trust chain or certificate name needs to be corrected.
$ComputerName = 'srv01.corp.internal'
Test-WSMan -ComputerName $ComputerName -UseSSLEnter-PSSession -ComputerName $ComputerName -UseSSL ` -Authentication Kerberos -Credential (Get-Credential)❯ Illustrative Output (Results Vary)
Test-WSMan returns the remote WS-Management identity.The interactive session prompt identifies srv01.corp.internal.Remove HTTP Only If Policy Requires It
Change ControlWinRM over HTTP can still use message encryption with Kerberos or NTLM, but some environments require HTTPS transport. If policy requires removing the HTTP listener, do so only after HTTPS remoting succeeds and you have a console or out-of-band recovery path. A domain GPO may recreate or manage the listener.
# Run on the server only after the HTTPS test succeeded and the change is approved.winrm delete 'winrm/config/Listener?Address=*+Transport=HTTP'winrm enumerate winrm/config/listener❯ Illustrative Output (Results Vary)
The HTTPS listener remains available on port 5986.No HTTP listener is listed when policy requires its removal.
Figure 1: WinRM exposes the HTTPS listener on port 5986, and the remote WS-Man identity check succeeds over SSL.
Your feedback keeps these production procedures accurate and battle-tested.