2017-12-04 3 views
0

Azure RunbookスクリプトのWINRM HTTPクライアントを使用してAzure Active Directoryドメインコントローラに接続されたAzure仮想マシンでリモートコマンドを実行しようとしました。 ここに私のリモートセッションに接続するコードがあります。Azure - runbookスクリプトを使用してAzure仮想マシンとのリモートセッションを確立できませんでした。

コード:

$uri- kerberoscluster.eastus2.cloudapp.azure.com (WINRM HTTP port 5985 and WINRM HTTPS port 5986 were enabled) 

    $cred- New-Object -typename System.Management.Automation.PSCredential -argumentlist $vmusername, $vmsecurepassword 

New-PSSession -ComputerName $uri -Credential $cred 

私はランブックスクリプトを使用して紺碧の仮想マシンにリモートコマンドを実行する必要があります。しかし、Runbookスクリプトの実行は、次の例外を除いて中断されました。オンプレミスネットワークでも同じことがうまく機能しています。

New-PSSession : [kerberoscluster.eastus2.cloudapp.azure.com] Connecting to remote server 
kerberoscluster.eastus2.cloudapp.azure.com failed with the following error message : WinRM cannot complete the 
operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and 
that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM 
firewall exception for public profiles limits access to remote computers within the same local subnet. For more 
information, see the about_Remote_Troubleshooting Help topic. 
At line:1 char:1 
+ New-PSSession -ComputerName $uri -Credential $cred -UseSSL -SessionOption $sessi ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin 
    gTransportException 
    + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionOpenFailed 

にすべてのヘルプは、次のようになります。

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: [kerberoscluster.eastus2.cloudapp.azure.com] Connecting to remote server kerberoscluster.eastus2.cloudapp.azure.com failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. 
https://docs.microsoft.com/en-us/azure/automation/automation-troubleshooting-automation-errors#troubleshoot-common-errors-when-working-with-runbooks 

は、そしてまた、私は https://blogs.technet.microsoft.com/rohit-minni/2017/01/18/remoting-into-azure-arm-virtual-machines-using-powershell/

は、以下の例外を手に入れた、以下のリンクを参照してWinRM HTTPSクライアントを使用してリモートセッションに接続しようとしています大いに感謝します。

答えて

0

runbookを実行するために使用される組織ユーザーIDまたはSPNに、VMを含むリソースグループに対する権限が必要ですか?このエラーは通常、アクセス権の問題が原因で発生します。

関連する問題