Saya mencoba untuk terhubung ke non-domain bergabung dengan server Win2008R2 jarak jauh menggunakan PS dari host Win8 (subnet yang sama, ini adalah VM lokal). Mencoba semua yang bisa kutemukan, tidak ada yang berhasil.
SERVER:
PS C:\Users\Administrator> winrm quickconfig
PS C:\Users\Administrator> enable-psremoting
KLIEN:
PS C:\scripts> $cred = get-credential -username "administrator" -message "Enter password"
PS C:\scripts> $sess = new-pssession -computername 10.10.106.2 -credential $cred -authentication default
new-pssession : [10.10.106.2] Connecting to remote server 10.10.106.2 failed with the following error message : The
WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client
computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the
TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts
list might not be authenticated. You can get more information about that by running the following command: winrm help
config. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:9
+ $sess = new-pssession -computername 10.10.106.2 -credential $cred -authenticatio ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : ServerNotTrusted,PSSessionOpenFailed
PS C:\scripts> winrm set winrm/config/client '@{TrustedHosts="10.10.106.2"}'
WSManFault
Message = The client cannot connect to the destination specified in the request. Verify that the service on the dest
ination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running o
n the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the
destination to analyze and configure the WinRM service: "winrm quickconfig".
Error number: -2144108526 0x80338012
The client cannot connect to the destination specified in the request. Verify that the service on the destination is run
ning and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destinat
ion, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination t
o analyze and configure the WinRM service: "winrm quickconfig".
PS C:\scripts> $sess = new-pssession -computername 10.10.106.2 -credential $cred -usessl
new-pssession : [10.10.106.2] Connecting to remote server 10.10.106.2 failed with the following error message : WinRM
cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over
the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By
default, the WinRM firewall exception for public profiles limits access to remote computers within the same local
subnet. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:9
+ $sess = new-pssession -computername 10.10.106.2 -credential $cred -usessl
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin gTransportException
+ FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionOpenFailed
Oh dan RDP berfungsi dengan baik antara dua host dengan kredensial yang sama.
Bahkan ini berfungsi:
PS C:\scripts> Get-WinEvent -computername 10.10.106.2 -credential $cred
sumber
winrm set winrm/config/client '@{TrustedHosts="10.10.106.1"}'
bekerja di server, tetapi saya masih mendapatkan pesan kesalahan yang sama pada klien saya, masih tidak terhubung.Masalah saya adalah misalnya dihosting di AWS.
Saya harus memodifikasi aturan firewall untuk memungkinkan 5.985 untuk semua profil dan alamat jarak jauh
New-NetFirewallRule -Name PsRemotingHttp -Direction Inbound -Action Allow -Protocol tcp -LocalPort 5985 -DisplayName PsRemotingHttp
Saya mengerjakan ini ketika saya menjalankan tes-wsman:
"Secara default, pengecualian firewall WinRM untuk profil publik membatasi akses ke komputer jarak jauh dalam subnet lokal yang sama."
sumber
Saya akhirnya mendapatkan milik saya untuk bekerja ... di mana xxx.xxx.xxx.xxx adalah Alamat IP.
sumber
Setelah berbulan-bulan masalah ini, bagi saya ternyata saya perlu menambahkan IP dari Remote Server dan itu Nama DNS ke host tepercaya. Menambahkan IP saja tidak cukup!
sumber