• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

service stopping


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", "");
            if (sc.Status.Equals(ServiceControllerStatus.Running))

but is giving me the error as follows

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

can you please guide me how to go ahead.I am using c#.net not asp.net
  • 3
1 Solution
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)
praveen1981Author Commented:

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..
praveen1981Author Commented:

I have used the ConnectionOptions  class

which is present under the System.Management; namespace

these solved the problem.
praveen1981Author Commented:
it solved the problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now