Search code examples
powershell

WinRM cannot complete the operation. Verify that the specified computer name is valid


When I try to fetch the service information on remote computer I got an WINRM error.

 PS C:\Windows\system32> invoke-command -computername Node1 -ScriptBlock {gsv}
 [Node1] Connecting to remote server Node1 failed with the following error      
 message : WinRM cannot complete the operation. Verify that the specified computer 
 name is valid, that the computer is accessible over the network, and that a firewall 
 exception for the WinRM service is enabled and allows access from this computer. By 
 default, the WinRM firewall exception for public profiles limits access to remote computers
 within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo          : OpenError: (Node1:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken

Solution

  • Try below workaround to fix WINRM issue.

    Connect to Remote server and run below command from cmd as a administrator.

        C:\Windows\system32>WinRM quickconfig
     WinRM service is already running on this machine.
     WinRM is not set up to allow remote access to this machine for management.
     The following changes must be made:
    
     Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this
     machine.
    
     Make these changes [y/n]? y
    
     WinRM has been updated for remote management.
    
     Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this
     machine.