Enter-PSSession não está funcionando para acessar a estação de trabalho associada ao domínio

0

Introdução

Estou sentado em um servidor Windows Server 2012 R2 e estou tentando Enter-PSSession em outra máquina.

Eu executei Enable-PSRemoting no computador remoto e isso não ajudou.

Detalhes do computador

Computador local

  • SO: Windows Server 2012 R2
  • IP 10.1.1.1/24
  • HOSTNAME.exe : server
  • ECHO %USERNAME% : usuário1
  • ECHO %USERDOMAIN% : example
  • WHOAMI.exe : example \ user1
  • Domínio em "control.exe system" : example.test
  • Nome completo do computador em "control.exe system" : server.example.test
  • $PSVersionTable.PSVersion | FT -H : 5 0 10586 117

Computador remoto

  • SO: Windows 7 Enterprise
  • IP 10.1.1.2/24
  • HOSTNAME.exe : estação de trabalho
  • ECHO %USERNAME% : Administrador
  • ECHO %USERDOMAIN% : estação de trabalho
  • WHOAMI.exe : estação de trabalho \ Administrador
  • Domínio em "control.exe system" : example.test
  • Nome completo do computador em "control.exe system" : workstation.example.test
  • $PSVersionTable.PSVersion | FT -H : 2 0 -1 -1

O que eu tentei

Tentativas 1-6 de server.example.test:

PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential Administrator
PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential example\Administrator
PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential example.test\Administrator
PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential User1
PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential example\User1
PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential example.test\User1

Todos recebem a mesma saída:

Enter-PSSession : Connecting to remote server workstation.example.test failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName workstation.example.test -credential Admin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (workstation.example.test:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Isso não faz sentido porque sei com absoluta certeza que a senha está correta.

Tentativas 7-8 de server.example.test

PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential workstation\Administrator
PS C:\Users\User1> Enter-PSSession -ComputerName workstation.example.test -credential workstation\User1

Estes dois obtêm esta saída:

Enter-PSSession : Connecting to remote server workstation.example.test failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request.
 Possible causes are:
  -The user name or password specified are invalid.
  -Kerberos is used when no authentication method and no user name are specified.
  -Kerberos accepts domain user names, but not local user names.
  -The Service Principal Name (SPN) for the remote computer name and port does not exist.
  -The client and remote computers are in different domains and there is no trust between the two domains.
 After checking for the above issues, try the following:
  -Check the Event Viewer for events related to authentication.
  -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.
 Note that computers in the TrustedHosts list might not be authenticated.
   -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName workstation.example.test -credential works ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (workstation.example.test:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Alguém sabe por que isso não está funcionando?

    
por Rhyknowscerious 21.09.2017 / 01:00

1 resposta

0

Eu passei por todos os problemas para escrever isso e depois resolvi antes de postar, então se você está tendo o mesmo problema, espero que isso ajude.

No server.example.test, abra o PowerShell como Admin e insira um destes comandos:

  1. Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value *
  2. Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value *.example.test
  3. Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value workstation.example.test

O primeiro permitirá que seu computador local se conecte a qualquer computador remoto.

O segundo permitirá o acesso remoto a qualquer computador no domínio example.test.

O terceiro permitirá acesso remoto apenas a workstation.example.test.

Acho que a sintaxe para adicionar várias entradas é apenas uma string com valores separados por vírgulas que seria algo assim:

Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value "192.168.0.1,192.168.0.2"

    
por 21.09.2017 / 01:00