5

Starałem się radzić sobie z winrm i TrustedHosts, ale bez skutku. Po kilku eksperymentach dowiedziałem się, że to pole winrm/config/client jest ograniczone do 1023 symboli, co nie jest wystarczające, szczególnie jeśli dodajemy hosty przez ich ipv6. cytuję z Installation and Configuration for Windows Remote Management: A trusted hosts list should be set up when mutual authentication cannot be established.Połącz się ze zdalnym serwerem przy użyciu winrm bez dodawania serwera do TrustedHosts

Również w tym samym pliku mówi tekst: Other computers in a workgroup or computers in a different domain should be added to this list. Więc pomyślałem, że oznacza to, że tak długo jak dwa komputery są w tej samej domenie, powinien być w stanie uzyskać dostęp do jednego z nich z inne używające winrm.

Próbowałem dodać dwa komputery do domeny testowej i wykonane:

winrm get winrm/config/client -r:192.168.100.1 -u:user -p:pass

Z jednego z nich do drugiego, ale nie powiodło się z powodu błędu:

WSManFault 
    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 ad 
ded to the TrustedHosts configuration setting. Use winrm.cmd to configure Truste 
dHosts. You can get more information about that by running the following command 
: winrm help config. 

Error number: -2144108316 0x803380E4 
The WinRM client cannot process the request. If the authentication scheme is dif 
ferent 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 Tru 
stedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. You ca 
n get more information about that by running the following command: winrm help c 
onfig. 

Po dodaniu 192.168 .100.1 do TrustedHosts powyższe zapytanie się powiedzie. Moje pytanie brzmi: czy można używać WinRM między dwoma hostami bez modyfikowania TrustedHosts? Ustawienie Zaufanych hostów na * nie jest dla mnie opcją.

Odpowiedz

10

Jeśli oba urządzenia są w tej samej domenie, powinieneś być w stanie użyć NazwaKomputera zamiast adresu IP. Kiedy używasz adresu IP, jesteś prawie zmuszony do korzystania z TrustedHosts z tego, co widziałem.

+2

Przepraszamy za opóźnienie. Może to być zabawne, ale nie mogłem znaleźć tego nigdzie w Internecie, że jeśli używasz ComputerName, nie musisz niczego dodawać do TrustedHosts. Ale sprawdziłem, czy działa :) –

Powiązane problemy