Некоторые из наших серверов (W2K8 R2) были перенесены в облако на прошлой неделе, после того, как мой скрипт powerswhell начал сбой (раньше работал нормально), исключение бросили на линии, где соединение пытается быть установлено,WinRM не может обработать запрос - сбой только по определенному домену
$ExSession = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri "http://$g_strExchangeServer/PowerShell" `
-Credential $Credentials –Authentication Kerberos
со следующим сообщением,
[subd.staging.com] Connecting to remote server failed with the following error message :
**WinRM cannot process the request**. The following error occured 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 onfig. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionOpenFailed
это происходит только тогда, когда я пытаюсь предназначаться наш домен тестирования, если я указываю сценарий к наш производственный домен тогда работает.
Эта же ошибка отображается на всех серверах, которые уже были перемещены в облако.
Обратите внимание, что все серверы, которые еще не переместились в облако, могут без проблем запускать сценарий на обоих доменах.
Я пробовал следующее, но не повезло.
//Add the destination computer to the WinRM TrustedHosts configuration setting.
c:\>WinRM set winrm/config/client @{TrustedHosts="stagingserver"}
//Confirm that WinRM is properly configured.
c:\>Winrm quickconfig
//Make sure that the remote server allows commands from any machine.
PS c:\>Set-item wsman:localhost\client\trustedhosts -value *
Использование Powershell v2 и WinRM v2
Любые комментарии приветствуются.
Вероятно, это: «Клиент и удаленные компьютеры находятся в разных доменах, и между двумя доменами нет доверия». Попробуйте использовать CredSSP. Вот как включить его: http://technet.microsoft.com/en-us/library/hh849872.aspx – user1578107
@ user1578107, я попробовал, но не повезло, c: \> enable-wsmancredssp -role клиент -delegatecomputer stagingserver. Команда была выполнена правильно, потому что я не получил никакой ошибки от PS, но сценарий все еще не работает с тем же сообщением об ошибке. Благодарю. – g3n1t0
Я не уверен, что enable-wsmancredssp позволяет перенаправлять новые учетные данные. Вы можете попробовать включить его вручную (см. Http://msdn.microsoft.com/en-us/library/windows/desktop/ee309365(v=vs.85).aspx) – user1578107