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

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.

Is WinRM enabled on both computers???

Run

winrm quickconfig

and check it.


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

Tags:

Powershell