views:

98

answers:

2

i m using the following code.

         ServiceController MyController = new ServiceController();
         MyController.MachineName = server_txt.Text.Trim();
         MyController.ServiceName = "Service1";


         string msg = MyController.Status.ToString();
         Label1.Text = msg;

This code work fine in the network computers where i have access. how to change this that it works for the systems present in different domain using credentials. please help me.

A: 

Maybe try doing so with WMI

Shay Friedman
A: 

Here's a link to someone trying a similar approach; their finding is that they need a login on the remote machine that matches the login on the machine which is running the program.

STW