Powershell – WinRM listener is not all ears

powershellwinrm

This is what happens when I try and connect to Powershell on my remote machine:

PS C:\Users\Jonathan> Test-WSMan -ComputerName 54.228.XX.XX
Test-WSMan : The WinRM client cannot complete the operation within the time specified. Check if the machine name is val
id and is reachable over the network and firewall exception for Windows Remote Management service is enabled.
At line:1 char:11
+ Test-WSMan <<<<  -ComputerName 54.228.XX.XX
    + CategoryInfo          : InvalidOperation: (54.228.XX.XX:String) [Test-WSMan], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

On my remote computer, I've confirmed that WinRM is running:

PS C:\Users\Administrator> net start winrm

The Windows Remote Management (WS-Management) service is starting.
The Windows Remote Management (WS-Management) service was started successfully.

I've confirmed that it is listening:

PS C:\Users\Administrator> winrm e winrm/config/listener

Listener
    Address = *
    Transport = HTTP
    Port = 5985
    Hostname
    Enabled = true
    URLPrefix = wsman
    CertificateThumbprint
    ListeningOn = 10.35.XXX.XXX, 127.0.0.1...

I've chosen to trust all hosts:

PS C:\Users\Administrator> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force

and finally, I've allowed inbound connections on port 5985. Have I missed something?!

Best Answer

I know this is an old thread, but I had the same issue and took me close to a full day to figure this out.

According to this reddit article, you have to update your firewall rules corresponding to "Windows Remote Management" to allow the connection (even if it is NOT SECURE)! As far as I can tell, that's the only way to make WinRM work in Server Manager since it uses HTTP, even in production environments!!