21

Powershellコマンドをリモートで実行すると少し混乱します。ServerAというテストサーバー(Win 2k8-R2-SP1)があり、PowerShellリモート処理が正しく有効になっています。私の開発マシン(Win 2k8-R2-SP1)から、PowerShellコマンドを正しくリモート実行できます。しかし、ServerB(Win 2k8-R2)という別のサーバーから同じコマンドを実行しようとすると、次のエラーが発生します。

[ServerA] Connecting to remote server failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service 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

3台のマシンはすべて同じドメインにあります。私の混乱は、開発マシンからServerAに完全に接続してコマンドを実行できることです。

ServerBにSP1がないという事実は、違いを生むでしょうか?お知らせ下さい。3台すべてのサーバーで管理者権限を持つ同じドメインアカウントを使用しています。

そして、私が試しているコマンドはです Invoke-Command -ComputerName ServerA -ScriptBlock {Get-UICulture}

助けてください。

ありがとう

4

7 に答える 7

29

winrm quickconfigまたはEnable-PSRemoting -forceServerBから実行します。

サービスがで実行されていることを確認しますget-service winrm

http://technet.microsoft.com/en-us/magazine/ff700227.aspx

また、ローカルの開発ボックスからこれを実行します。

Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
于 2011-09-02T15:18:14.650 に答える
5

過去にリモートpowershellで動作していたマシンでも、これと同じ問題が発生しました。私の場合、解決策はセキュリティ ログをクリアすることでした。満杯でした。これにより、powershell が適切な安全な接続を確立できなかったと思います。

于 2012-12-13T14:15:12.797 に答える
0

私は何日も答えを探していましたが、問題を見つけました。

IIS 7 .NET Extensibility コンポーネントがインストールされていなかったために、この問題が発生したようです。2012 R2 Exchange 2010 サーバーがあります。

https://technet.microsoft.com/en-us/library/dd421841(v=exchg.80).aspx

これをpowershellに入力してインストールしました。

Exchange 2010 の前提条件については、こちらを参照してください。

https://technet.microsoft.com/en-us/library/bb691354(v=exchg.141)

この Exchange サーバーにはメールボックスの役割しかなく、もう 1 つは CAS および HUB トランスポートです。

したがって、このコマンドが必要です。

Add-WindowsFeature NET-Framework-Features,RSAT-Clustering,Web-Mgmt-Console,WAS-Process-Model,Web-Basic-Auth,Web-Lgcy-Mgmt-Console,Web-Metabase,Web-Net-Ext,Web -サーバー、Web-Windows-Auth -再起動

Web-Net-Ext の一部は、IIS 7.NET Extensibility コンポーネントをインストールしました。再起動する必要はありません。

ちょうど私の2セント、多分これは他の誰かを助ける:-)

于 2017-07-19T07:39:23.610 に答える