Azure の仮想マシンでWindows Server 2012 Datacenterのインスタンスを作成しました。
こちらのサイトを参考にして、ローカルのPCからリモート接続しようと思ったのですが、つまづいています。
http://yaimairi.hateblo.jp/entry/2017/03/19/233916
PowerShellのコマンドは以下の通りです。
Enter-PSSession -ComputerName hogehoge.japaneast.cloudapp.azure.com -Port 5986 -Credential username -UseSSL
エラーメッセージは以下の通りです。
Enter-PSSession : リモート サーバー hogehoge.japaneast.cloudapp.azure.com への接続に失敗し、次のエラー メッセージが返さ
れました: WinRM は処理を完了できません。 指定したコンピューター名が有効であること、コンピューターにネットワーク経由でア
クセスできること、および WinRM サービスのファイアウォールの例外が有効になっていてこのコンピューターからアクセスできるこ
とを確認してください。 既定では、パブリック プロファイルの WinRM ファイウォールの例外によって、同一のローカル サブネッ
ト内のリモート コンピューターへのアクセスは制限されます。詳細については、about_Remote_Troubleshooting のヘルプ トピック
を参照してください。
発生場所 行:1 文字:1
- Enter-PSSession -ComputerName hogehoge.japaneast.cloudapp.azure.com - ...
-
+ CategoryInfo : InvalidArgument: (hogehoge.japaneast.cloudapp.azure.com:String) [Enter-PSSession]、PSRemo tingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
Azureポータルでネットワークセキュリティグループの設定を変更し、ポート5986を受け入れるようにしています。なので、仮想マシン側に問題があるのではと思いました。
仮想マシンにリモートデスクトップでログインして、以下のコマンドでローカルに接続してみました。成功しました。
Enter-PSSession -ComputerName localhost -Port 5985 -Credential username
しかし、ポートを5986にしてSSL接続しようとすると、以下のようなエラーになります。
PS C:\Users\username> Enter-PSSession -ComputerName localhost -Port 5986 -Credential username -UseSSL
Enter-PSSession : Connecting to remote server localhost 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.
At line:1 char:1
- Enter-PSSession -ComputerName localhost -Port 5986 -Credential username -UseSSL
-
+ CategoryInfo : InvalidArgument: (localhost:String) [Enter-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
どうもポート5986での接続がそもそもできないようです。
ファイアーウォールの設定を見たところ、ポート5986の設定がありません。5985はあります。
こちらの記事によると、証明書の取得が必要らしいですが、ブラウザで開くことがそもそもできません。
http://kendik.hatenablog.com/entry/2014/01/11/003107
目的は、ローカルのPCからPowerShellでリモート接続する事なのですが、どうすればいいのでしょうか?

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。