2

machineName have tried executing a script using invoke-command in the following way:

 Invoke-command -filepath C:\scripts\GettMembers.ps1 -computername "machinename" -credential $Getcredential 

But I am getting the following error :

Connecting to remote server failed with the following error message : The WinRM client cannot process the request because the server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic.

But I was able to add the machine to the trusted hosts of the local machine using the following command :

winrm set winrm/config/client `@{TrustedHosts="machineName"}' 
3
  • So presumably you command actually looks like this: Invoke-Command -computername madhsubr-lap.idc.oracle.com ...? That is, your not really using "machinename", right? :-) Have you tried nslookup on madhsubr-lap.idc.oracle.com?
    – Keith Hill
    Dec 5, 2013 at 17:43
  • Seems to be a name resolution (DNS) error. Try nslookup <remotecomputer>
    – Frode F.
    Dec 5, 2013 at 17:47
  • That was a mistake.I am using machine name itself,i.e, the machine name used in the invoke-command and the winrm set command is the same. I tried running nslook up on the machine.I am getting the following exception:'can't find machineName: Non-existent domain'
    – cmm user
    Dec 6, 2013 at 6:35

3 Answers 3

5

The problem appears to be that "machinename" isn't something your DNS knows how to resolve. This isn't a powershell problem, but rather a system configuration problem.

You can verify this by asking powershell to resolve the machine name with something like this:

$machine = "machinename"
[System.Net.Dns]::GetHostEntry($machine)

If you get an error, that means that you're using a machine name that can't be resolved (ie: windows can't convert "machinename" to an IP address). It's not a matter of trust or permissions, it's that your computer doesn't think "machinename" is a valid machine on your network.

Have you tried using a fully qualified address (eg: machinename.mycompany.com)?

3

I was getting this error on two servers that were configured for DNS and could ping the target. The resolution was this command:

netsh winhttp reset proxy

Credit to the following blog: http://directaccessguide.com/2014/03/05/winrm-client-errors-in-remote-access-console/

1
  • Although completely unlikely, this saved our problem after days of experimenting! Dec 5, 2019 at 9:58
-1

Just installed Exchange 2016 en had the "The WinRM client cannot process the request because the server name cannot be resolved" problem. Removed winhttp proxy setting and BAM!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.