Một số máy chủ của chúng tôi (W2K8 R2) đã được chuyển sang đám mây tuần trước, khi thực hiện kịch bản lệnh powerwhell của tôi bắt đầu thất bại (hoạt động tốt trước đây), ngoại lệ ném trên đường, nơi kết nối đang cố gắng để được thành lập,WinRM không thể xử lý yêu cầu - không chỉ trên một miền cụ thể
$ExSession = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri "http://$g_strExchangeServer/PowerShell" `
-Credential $Credentials –Authentication Kerberos
với thông điệp sau đây,
[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
này chỉ xảy ra nếu tôi cố gắng để nhắm mục tiêu miền thử nghiệm của chúng tôi, nếu tôi chỉ kịch bản để miền sản xuất của chúng tôi sau đó nó hoạt động.
Lỗi tương tự được hiển thị trên tất cả các máy chủ đã được chuyển sang đám mây.
Lưu ý rằng tất cả các máy chủ chưa chuyển sang đám mây đều có thể chạy tập lệnh trên cả hai miền mà không gặp bất kỳ sự cố nào.
Tôi đã thử những điều sau, nhưng không có may mắn.
//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 *
Sử dụng Powershell v2 và WinRM v2
Bất kỳ ý kiến được hoan nghênh.
Có thể, đây là: "-Khách hàng và máy tính từ xa ở các miền khác nhau và không có sự tin cậy giữa hai tên miền". Hãy thử sử dụng CredSSP. Đây là cách để kích hoạt nó: http://technet.microsoft.com/en-us/library/hh849872.aspx – user1578107
@ user1578107, tôi đã thử nhưng không may mắn, c: \> enable-wsmancredssp -role client -delegatecomputer stagingserver. Lệnh được thực hiện đúng vì tôi không nhận được bất kỳ lỗi nào từ PS, tuy nhiên tập lệnh vẫn không thành công với cùng một thông báo lỗi. Cảm ơn. – g3n1t0
Tôi không chắc liệu enable-wsmancredssp có cho phép chuyển tiếp thông tin đăng nhập mới hay không. Bạn có thể thử kích hoạt nó theo cách thủ công (xem http://msdn.microsoft.com/en-us/library/windows/desktop/ee309365(v=vs.85).aspx) – user1578107