2012-03-31 9 views
0

リモートコンピュータでクエリ(たとえばCIM_Memory)を実行したい場合は、仮想マシンです。私はPowershellでこのコードを使用します:Powershellのリモートマシン上のWMIクエリ

Get-WmiObject CIM_Memory -ComputerName IPADDRESS -Credential USERNAME 

もちろん、実際のIPとユーザー名。 両方のOS(両方のWin7)でRemoteAdminが有効になっています。

私はこの例外を取得しています:

Exception from HRESULT: 0x80070005 (E_ACCESSDENIED) 

それがUAC機能でWin7のなので、ユーザーがアクセストークンを取得します。したがって、次のレジストリエントリがあります。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ LocalAccountTokenFilterPolicy 

この設定を1にしても、同じ例外が発生します。何が問題なの?

答えて

0

MSDNのWMI Troubleshootingセクションをお読みになりましたか?ここにあなたのエラーについて言われているものです。

0x80070005 – E_ACCESS_DENIED - Access denied by DCOM security.

The user does not have remote access to the computer through DCOM. Typically, DCOM errors occur when connecting to a remote computer with a different operating system version.

Give the user Remote Launch and Remote Activation permissions in dcomcnfg. Right-click My Computer-> Properties Under COM Security, click "Edit Limits" for both sections. Give the user you want remote access, remote launch, and remote activation. Then go to DCOM Config, find "Windows Management Instrumentation", and give the user you want Remote Launch and Remote Activation. For more information, see Connecting Between Different Operating Systems

0

は非常にあなたができる場合は、PSリモーティングを有効にお勧めします。こうすることで、ターゲットのコンピュータにローカルのwmiコールを実行して報告することができます。

WMIには、ファイアウォール、ランダムポートに関する多くの問題があります。

関連する問題