Jestem nowy w powershell i mam problemy z delegowaniem uprawnień. Mam następujący skrypt:Powielanie mocy Powershell - zasady nie zezwalają na przekazywanie danych uwierzytelniających użytkownika
$session = New-PSSession myserver -Authentication CredSSP -Credential DOMAIN\Administrator
Invoke-Command -Session $session -ScriptBlock { <Some PowerShell Command> }
Przed uruchomieniem go, zrobiłem następujący:
- Uruchom
Enable-PSRemoting
na mójserwer. - Uruchom
Enable-WSManCredSSP Server
na myserver. - Uruchom
Restart-Service WinRM
na myserver. - Uruchom klienta
Enable-WSManCredSSP Client –DelegateComputer myserver
na kliencie. - Ponownie uruchomiono serwer i klienta.
Ale kiedy uruchomić skrypt, pojawia się następujący komunikat o błędzie:
[myserver] Connecting to remote server failed with the following error message : The WinRM client cannot process the request. A computer policy does not allow the delegation of
the user credentials to the target computer. Use gpedit.msc and look at the following policy: Computer Configuration -> Administrative Templates -> System -> Credentials Delega
tion -> Allow Delegating Fresh Credentials. Verify that it is enabled and configured with an SPN appropriate for the target computer. For example, for a target computer name "m
yserver.domain.com", the SPN can be one of the following: WSMAN/myserver.domain.com or WSMAN/*.domain.com. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionOpenFailed
Sprawdziłem zasady jak wspomniano w komunikacie o błędzie, ale wszystko wydaje się być w porządku. Co jeszcze może mnie blokować?
Czy jesteś wymieniony jako administrator na swoim pilocie? – BlackHatSamurai
@Blaine: Użytkownik DOMAIN \ Administrator, którego próbuję podszywać się, jest administratorem zdalnego serwera. Jestem też połączony z komputerem klienta przy użyciu konta administracyjnego. – ChrisB
Czy włączyłeś zdalne wykonywanie skryptów w zdalnym polu: 'Enable-PSRemoting' – BlackHatSamurai