以下の内容はhttps://tech.guitarrapc.com/entry/2013/03/12/180345より取得しました。


PowerShellで出たWinRMのエラーメッセージを読むには

WinRMといえば、Windows Remote Management (WS-Management)ですね。

いわゆる、「PowerShellのリモート管理に利用される」といえばイメージしやすいでしょうか。

さて、このWinRMのエラーですが、System Center 2012のVirtual Machine Manager(VMM)状に16進数のコードで表示される場合があります。

例えば、0x80338000等です。

Warning (2915)
 The Windows Remote Management (WS-Management) service cannot process the request. The object was not found on the server (servername.domain.com).
 Unknown error (0x80041002) or Unknown error (0x80338000)

このサイトのエラーを参考に、PowerShell内部でエラーの概要を知る方法を見てみましょう。

How to troubleshoot the "Needs Attention" and "Not Responding" host status in System Center 2012 Virtual Machine Manager

エラーメッセージを見たい

簡単です。 winrmのhelpmsgを呼び出すだけです。

winrm helpmsg <ErrorCode>

例えば、上記のエラーなら

PS> winrm helpmsg 0x80338000
WS-Management サービスは要求を処理できません。サービスはリソース URI およびセレクターによって識別されたリソースを見つけられません。

あるいは、これは

PS> winrm helpmsg 0x80338104
WS-Management サービスは要求を処理できません。WMI サービスは 'アクセスが拒否されました' というエラーを返しました。

少しはエラー原因を探るのに便利ですね。なお、WinRMのエラーは必ず0x8033から始まります。

参考サイト

#PSTip Decoding WinRM error messages




以上の内容はhttps://tech.guitarrapc.com/entry/2013/03/12/180345より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14