none
How can i access remote machines without manully setting myself as admin RRS feed

  • Question

  • Hi am developing a small application in c# using WMI, here my job is to connect all the machines in my office and gets list of installed programs.

    If i wanna connect to remote machine I should be admin on that machine. we have 200 systems in my office, i cant be do this process manually in each and every system to make me as an admin and enable the WMI settings in Firewall.

    can any one tell me how can i get rid of this problem.

    here is the code snippet ...

    conOp = new ConnectionOptions();
                    conOp.Impersonation = ImpersonationLevel.Impersonate;
                    conOp.EnablePrivileges = true;
                    scope = new ManagementScope(@"\\" + _pcNumber + @"\root\cimv2", conOp);
                    scope.Connect();
                    sLabel.Text = "Processing.....  " + _pcNumber;
                    Application.DoEvents();
                    System.Management.ObjectQuery query = new System.Management.ObjectQuery("SELECT * FROM Win32_Product");
                    collection = new ManagementObjectSearcher(scope, query);
                    ManagementObjectCollection returnCollection = collection.Get();

      
    Thursday, July 19, 2012 5:17 AM

Answers

All replies