Enter-PSSession to remote server fails with “cannot find the computer”

前端 未结 5 1955
忘了有多久
忘了有多久 2021-01-03 21:55

My desktop is win7 and I am trying to connect to a server 2012.
Both hosts are on the same domain.

If I do:

Enter-PSSession -ComputerName *Serve         


        
相关标签:
5条回答
  • 2021-01-03 22:13

    run winrm quickconfig from a powershell session on the remote machine

    0 讨论(0)
  • 2021-01-03 22:21

    In my case DNS was was pointing to the right IP yet there wase a typo in the hostname so basicaly the parameter -Computername and the actual hostname didn't match.

    0 讨论(0)
  • 2021-01-03 22:27

    This is most likely caused by your netbios name being different from the server's hostname. Try to connect with the netbios name instead.

    • Determine the correct name by running the following command in powershell:

    "$env:COMPUTERNAME.$env:USERDNSDOMAIN"

    0 讨论(0)
  • 2021-01-03 22:27

    I know its very late but i am putting my fix to the few sites that experienced the same issue. for me it was a duplicate computer name in the root domain. found it by running setspn -f -q */servername. this popped up the server name in multiple domains. deleting the invalid machine from the root AD and root dns, and i was up and running.

    0 讨论(0)
  • 2021-01-03 22:30

    After talking to our domain admin I think I found the cause of the problem.
    The server is in a resource domain which only has a one way trust to the main OU.
    This explains why I can do PS remoting from the server to the clients but not vice versa.
    I found that I can use the IP address with the -Credential option in my case though which isn't nice but an acceptable workaround.

    0 讨论(0)
提交回复
热议问题