get 504 error when I use invoke-command

Hello community! I'm getting this error, while using invoke-command:

the winrm client received an http status code of 504 from the remote ws-management service

WinRM service is running on target. We're using the firewall only for Internet, it's disabled for local web-sites. Most of PC's is connected to Internet via Cisco AnyConnect, which gives IP to PC's itself. Connect between my and target machine is OK, no any packet is lost. Why i'm then getting such error?


  • Edited by Net Ranger Wednesday, May 20, 2015 8:09 AM
May 20th, 2015 8:09am

invoke-command -computername mypc -scriptblock {test-path c:\windows} and I got this: 

[mypc] Failure to connect to a remote server mypc. Error message: the WinRM client received an HTTP status code of "504" from the remote WS-Management service. Check "about_Remote_Troubleshooting" for details.
    + CategoryInfo          : OpenError: (wsvt-22664:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : -2144108273,PSSessionStateBroken

I'm also receive this msg, when using winrs commands, like winrs -r:mypc cmd.


  • Edited by Net Ranger Thursday, May 21, 2015 8:35 AM
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 8:26am

Don't have the WMF installed correctly where?

I'm going through a Cisco's switch. My PC (mypc) is in domain, same with others PC, on which I had used invoke-command.

invoke-command -scriptblock {test-path c:\windows} returns True statement.

In case of Enter-PsSession MyPC, I'm getting access is denied message, even if I have the highest permissions in domain.

On my (local) PC I'm execute this

PS C:\Users\adm> Test-WsMan


wsmid           : http://schemas.dmtf.org/wbem/
ProtocolVersion : http://schemas.dmtf.org/wbem/
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 3.0

But if I'm perfoming this command on an another compute (mypc in this case), I got this:

Test-WsMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859023" Machine="mypc.mydomain.com"><f:Message>the WinRM client received an HTTP status code of "504" from the remote WS-Management service. </f:Message></f:WSManFault>
line:1 char:1
+ Test-WsMan -ComputerName mypc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (wsvt-22664:String) [Test-WSMan], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand






  • Edited by Net Ranger Thursday, May 21, 2015 9:38 AM
May 21st, 2015 9:28am

Thanks for help. Gonna post here reply once Cisco gimme an answer.

By the way: shall I add to firewall profiles 80 and 443 ports as exceptions?

  • Edited by Net Ranger Thursday, May 21, 2015 10:25 AM
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 10:24am

As i mention above, I'm getting 'access is denied' when perfoming enter-pssesion command even when trying localhost as computername argument. Shall I reinstall WMF?

  • Edited by Net Ranger Thursday, May 21, 2015 11:42 AM
May 21st, 2015 11:40am

I have reinstalled the OS on my PC and error is gone.
  • Marked as answer by Net Ranger 20 hours 56 minutes ago
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2015 6:18am

I have reinstalled the OS on my PC and error is gone.
  • Marked as answer by Net Ranger Wednesday, June 10, 2015 10:13 AM
June 10th, 2015 10:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics