How to execute debug view on remote computer using wmi

1.2k Views Asked by At

I am looking to run Debugview on a remote machine (I have the username,password and the ip adress of that machine). I have developed this code

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);

This code starts the debugview on the remote computer in background(which can be viewed in taskmanager by selecting processes run by all users option) but the problem is, it does not connect the localhost.

so can anyone suggest me the changes or any other way to achieve what i am doing.

EDIT : GOT THE ANSWER

You need to have administrative rights to logon the remote computer so debug view gets connected automatically (to local host)

0

There are 0 best solutions below