Powershell remoting error - network path not found

First of all I created credential variable with my domain admin account:

$cred = get-credential - I typed my domain\username and password

Then I used IP address instead of hostname in -ComputerName parameter, so the enter-pssession looks like:

Enter-Pssession -ComputerName 192.168.1.111 -Credential $cred

this approach works for the invoke-command as well

invoke-command -ComputerName 192.168.1.111 -Credential $cred -ScriptBlock {hostname}

I still do not know why it does not work with the hostname and why do I have to create $cred, but as I need a quick solution, this works fine for me.

Thanks for help.


I had the exact same issue. Using the FQDN worked for me.

Chris N is right:

The network path was not found.

This is clearly a DNS resolution error; especially if the IP address is working. I would venture to say there are Name Suffix Routing issues.

The ComputerName description says that NETBIOS name should work, but it does not in my testing in my environment. The FQDN is another option for the -ComputerName property and fixed this error for me.

Try using (use your FQDN, of course):

Invoke-Command -ComputerName servera.vertigion.com

Note: Notice it's in all lowercase. Using camel case (serverA.vertigion.com) failed with the same error. I realize that typically nslookups are case-insensitive.

Note: I did NOT have the issue with the Enter-PSSession command. I believe there's a bug (or at least a blatant inconsistency) with Invoke-Command.

More info: http://go.vertigion.com/PowerShell_Invoke-Command