リモート マシンで Debugview を実行しようとしています (そのマシンのユーザー名、パスワード、IP アドレスを持っています)。私はこのコードを開発しました
object[] theProcessToRun = { "C:\\Dbgview.exe /t /l C:\\debugview1.log" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Username = "Username";
theConnection.Password = "Password";
ManagementScope theScope = new ManagementScope("\\\\ipaddress\\root\\cimv2", theConnection);
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);
このコードは、バックグラウンドでリモートコンピューターのデバッグビューを開始します (すべてのユーザーが実行するプロセスを選択することでタスクマネージャーで表示できます) が、ローカルホストに接続しないという問題があります。
誰でも、私がやっていることを達成するための変更やその他の方法を提案できます。
編集:答えを得ました
デバッグ ビューが自動的に (ローカル ホストに) 接続されるように、リモート コンピューターにログオンするには管理者権限が必要です。