Link to home
Start Free TrialLog in
Avatar of praveen1981
praveen1981Flag for India

asked on

service stopping

Hi

I want to stop the service which is running on the remote machine , it contains only administrative access

I am using the following code


              ServiceController sc = new ServiceController("ReceiveService", "1.1.1.141");
            if (sc.Status.Equals(ServiceControllerStatus.Running))
                sc.Stop();



but is giving me the error as follows

//Cannot open Service Control Manager on computer '1.1.1.141'. This operation might require other privileges.


can you please guide me how to go ahead.I am using c#.net not asp.net
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Does .NET program is running on a machine /user who has admin right on other machine?

In other words:

Does your user's network privileges  able to access the Service Control Manager on the Server. Ask your network admin to give your user priviledge to stop services(TCUniversalServerAdmins)
Avatar of praveen1981

ASKER

Hi

here  .NET code is running under the user machine  and services is running on the remote machine which contains with admin previlages , so now the code which is running on the user machine want to stop the services which is running on remote machine..

can you  please guide me..
ASKER CERTIFIED SOLUTION
Avatar of praveen1981
praveen1981
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it solved the problem.