Winrm connection is failing with error One or more computer names are not valid. If you are trying to pass a URI, use the -ConnectionUri

While using winrm connection, The execution might fail with below error(although ip/dns hostname looks good and reachable via delegate).

ERROR   2022-07-27 15:24:38 Invoke-Command : One or more computer names are not valid. 
                            If you are trying to pass a URI, use the -ConnectionUri
ERROR   2022-07-27 15:24:38    parameter, or pass URI objects instead of strings.

In this case please check the underlying winrm connector used for the execution and make sure there is no empty common parameters key:value pair is present as below:

Solution: Please remove the empty parameter by clicking on trash icon and make sure only valid key:value pair remain there if you need to pass any parameters.

1 Like