Configuring WinRM Secure for SIA Target Systems
Steps
Command: winrm quickconfig -transport:https
This command configures Windows Remote Management (WinRM) to use an HTTPS listener on port 5986 instead of the default HTTP listener on port 5985. The actions taken are as follows:
- Starts the WinRM service and sets it to Automatic startup.
- Searches for a valid X.509 server certificate in the Local Machine’s Personal store (Cert:\LocalMachine\My) that:
- Has Server Authentication Enhanced Key Usage (EKU, OID: 1.3.6.1.5.5.7.3.1).
- Matches the server’s hostname/FQDN in the Common Name (CN) or Subject Alternative Name (SAN).
- Includes a private key.
- Creates an HTTPS listener bound to the certificate if found.
- Configures firewall rules to allow inbound traffic on port 5986.
Limitations
- Fails if no valid certificate is found.
- May select an unintended certificate if multiple certificates are present.
- May not work consistently on older Windows versions or with misconfigured certificates.
Checking the Certificate
Command: winrm enumerate winrm/config/listener
This command lists all configured WinRM listeners, including transport (HTTP/HTTPS) and certificate details (e.g., CertificateThumbprint).

Steps to Verify Certificate
- Copy the CertificateThumbprint from the command output.
- Open certlm.msc (Local Computer certificate store).
- Right-click “Certificate - Local Computer,” select “Find Certificate.”
- Paste the thumbprint and use SHA1 Hash to locate the certificate.

Certificate Requirements
- Must include Server Authentication Enhanced Key Usage (EKU, OID: 1.3.6.1.5.5.7.3.1).
- Common Name (CN) or Subject Alternative Name (SAN) must match the hostname or FQDN of the target system running the WinRM service.
Changing to a Different Certificate
- Get the New Thumbprint
- Retrieve the thumbprint of the new certificate using PowerShell:
- $newThumbprint = (Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.Subject -like "*server.example.com*" }).Thumbprint
- Alternatively, find it in certlm.msc (Local Machine > Personal > Certificates > Details > Thumbprint).
- Verify the certificate has a private key (in certlm.msc, check for “You have a private key” in the certificate properties).
- Remove the Old HTTPS Listener
- Delete the existing HTTPS listener:
- winrm delete winrm/config/Listener?Address=*+Transport=HTTPS
- Configure the New HTTPS Listener
- Create a new HTTPS listener with the new certificate:
- PowerShell
- winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname=$hostname;CertificateThumbprint=$newThumbprint}
- $hostname = "server.example.com"
- $newThumbprint = "NEW_CERT_THUMBPRINT" # Replace with actual thumbprint
- Replace “server.example.com” with the server’s FQDN (matching the new certificate’s CN/SAN).
- Replace NEW_CERT_THUMBPRINT with the new thumbprint (no spaces).
- Verify the New Listener
- Test the configuration:
- Test-WSMan -ComputerName server.example.com -UseSSL -Authentication Default
- Successful Output: Returns an object with:

What does this mean?
- wsmid: Confirms the WS-Management identity schema, indicating the WinRM service is responding.
- ProtocolVersion: Shows the WS-Management protocol version supported.
- ProductVendor: Identifies Microsoft as the vendor (since WinRM is a Microsoft service).
- ProductVersion: Indicates the Windows OS version and WinRM stack version (e.g., 10.0.17763 corresponds to Windows Server 2019).