Подтвердить что ты не робот

WinRM не может обработать запрос - происходит только через определенный домен

Некоторые из наших серверов (W2K8 R2) были перенесены в облако на прошлой неделе, после того, как я закончил работу с моими полномочиями script (раньше работал нормально), исключение выбрасывается в строке, где соединение пытается быть установленным,

$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

это происходит, только если я пытаюсь настроить таргетинг на наш тестовый домен, если я укажу script на наш производственный домен, тогда он работает.

Такая же ошибка отображается на всех серверах, которые уже были перемещены в облако.

Обратите внимание, что все серверы, которые еще не переместились в облако, могут без проблем запускать script на обоих доменах.

Я пробовал следующее, но не повезло.

//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

Любые комментарии приветствуются.

4b9b3361

Ответ 1

Запустите эти команды на клиентском компьютере, затем попытайтесь связаться с удаленным хостом:

Сначала нам нужно проверить TrustedHosts на клиентской машине:

PS C:\> WinRM get winrm/config/client
Client
    NetworkDelayms = 5000
    URLPrefix = wsman
    AllowUnencrypted = false
    Auth
        Basic = true
        Digest = true
        Kerberos = true
        Negotiate = true
        Certificate = true
        CredSSP = false
    DefaultPorts
        HTTP = 5985
        HTTPS = 5986
    TrustedHosts

Если он пуст, как в примере, выполните команду ниже на машине клиент:

PS C: > Set-item wsman: localhost\client\trustedhosts -value *

Это будет записывать * в параметр TrustedHosts, который позволит клиентскому компьютеру подключаться к любому хосту, или вы можете настроить это значение с помощью ip и/или имени хоста целевого сервера.

PS C:\> WinRM get winrm/config/client
Client
    NetworkDelayms = 5000
    URLPrefix = wsman
    AllowUnencrypted = false
    Auth
        Basic = true
        Digest = true
        Kerberos = true
        Negotiate = true
        Certificate = true
        CredSSP = false
    DefaultPorts
        HTTP = 5985
        HTTPS = 5986
    TrustedHosts = *