4
votes

New-PSSession does not work when using the HostName of a server, but does with the IP. Both local and remote machines are on the same domain.

PS C:\Windows\system32> new-PSSession -ComputerName "SERVERNAME" new-PSSession : [SERVERNAME] Connecting to remote server SERVERNAME failed with the following error message : WinRM cannot process the request. The following error occurred while using Kerberos authentication: Cannot find the computer SERVERNAME. Verify that the computer exists on the network and that the name provided is spelled correctly. For more information, see the about_Remote_Troubleshooting Help topic.

I've also tried Ping, RDP and Test-WSMan which are all successful using the servers Hostname.

Any ideas on what could be going wrong?

1
Can you resolve the IP if you use nslookup?FoxDeploy
Just did it now and Yes I canArcSet
My guess from the error is the DC authenticating you couldn't reach the server. Is it in DNS network wide, or just resolvable from your machine? Or not resolvable from the DC?Mark Wragg
There's another similar question that talks about the issue being due to one way trust and workaround of passing credentials directly with the -credential parameter: stackoverflow.com/q/30568727/2796058Mark Wragg
A) Shouldn't be a one way trust since its on same domain. B) I would have expected the error message to be different from a DC authenticating issue. Something like "No Logon Servers Found" or Access denied type message. Would this not be the case?ArcSet

1 Answers

-1
votes

Seems like SelfSignedCertificate issue ,

Delete the old WinRM listener

winrm delete winrm/config/Listener?Address=*+Transport=HTTPS

Create New-SelfSignedCertificate with Domain name

1.New-SelfSignedCertificate -DnsName "" -CertStoreLocation Cert:\LocalMachine\My

Update the SelfSignedCertificate _THUMBPRINT

2.winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname=""; CertificateThumbprint=""

3.Add a new firewall rule

$port=5986 netsh advfirewall firewall add rule name="Windows Remote Management (HTTPS-In)" dir=in action=allow protocol=TCP localport=$port

Please refer link :

http://www.visualstudiogeeks.com/devops/how-to-configure-winrm-for-https-manually