Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

powershell

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
like image 200
Ramesh Murugesan Avatar asked Oct 07 '16 12:10

Ramesh Murugesan


Video Answer


1 Answers

Have you checked the remote computer's firewall rules? The default rule only allows IPs in the local subnet.

To allow other IPs:

  1. Open Windows Firewall with Advanced Security
  2. Click Inbound Rules
  3. Double-click Windows Remote Management (HTTP-In) for the Public profile
  4. Click the Scope tab
  5. Under Remote IP address, add any IPs you need

A screenshot of a WinRM firewall rule on which the remote IP address must be in the local subnet

like image 162
Eric Eskildsen Avatar answered Oct 07 '22 09:10

Eric Eskildsen