2011-09-07 25 views
8

Tôi đang cố gắng để thực hiện các tuyên bố sau trên máy chủ của sâu vùng xa:PowerShell: lỗi thực hiện lệnh bằng cách sử dụng lệnh gọi?

Invoke-Command -ComputerName server1 -ScriptBlock {Get-Process} 

nhưng tôi nhận được một thông báo lỗi:

[server1] Connecting to remote server failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the serv 
ice on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS 
or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more 
information, see the about_Remote_Troubleshooting Help topic. 
    + CategoryInfo   : OpenError: (:) [], PSRemotingTransportException 
    + FullyQualifiedErrorId : PSSessionStateBroken 

lý do cho điều này và làm thế nào để khắc phục nó như thế nào?

+3

thử gõ Enable-PSRemoting trong máy tính từ xa. –

Trả lời

16

Có 2 lý do basical:

1) máy tính từ xa đã không Powershell cài đặt

2) PSremoting không được kích hoạt trên máy tính từ xa (để kích hoạt nó đọc nhận xét của tôi trong bạn trả lời)

+1

Bật-PSRemoting đã giúp! – jrara

+0

PS: trong trường hợp "Enable-PSRemoting" của tôi là không đủ, tôi phải chạy sau "Enable-WSManCredSSP -Role Server" để làm việc đó. – expirat001

Các vấn đề liên quan