Я новичок в powershell, и у меня возникают проблемы с использованием делегирования полномочий. У меня есть следующий script:
$session = New-PSSession myserver -Authentication CredSSP -Credential DOMAIN\Administrator
Invoke-Command -Session $session -ScriptBlock { <Some PowerShell Command> }
Перед запуском, я сделал следующее:
- Запустите
Enable-PSRemoting
на сервере myserver. - Запустите
Enable-WSManCredSSP Server
на myserver. - Запустите
Restart-Service WinRM
на сервере myserver. - Запустите
Enable-WSManCredSSP Client –DelegateComputer myserver
на клиенте. - Перезагрузите сервер и клиент.
Но как только я запустил script, я получаю следующее сообщение об ошибке:
[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
Я проверил политики, упомянутые в сообщении об ошибке, но все кажется прекрасным. Что еще может блокировать меня?