How to start and stop windows Services on remote machine using C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pnalla
    New Member
    • Nov 2008
    • 13

    How to start and stop windows Services on remote machine using C#

    hi,

    I can aceess ths windows services on remote machine. but i can not start and stop the services.it gives some error message like " can not open 'service name' on comuter 'machine name'.
    Please suggest me....

    thanks
    prasad
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    First up, open your Service Manager on your local computer and connect it to the remote computer...

    Find the relevant service and make sure you can stop it and restart it by this means. If you can, then great, you should be able to stop it using code. If you can't stop it, it's because you don't have the relevant permissions so you'll have to provide a means to stop/start it using a different user token.

    Comment

    • pnalla
      New Member
      • Nov 2008
      • 13

      #3
      Thanks a lot for reply.

      I was able to access the service manager of remote computer but i was not able to restart or start/stope the services. please can u tell me how to get the privileges, is it necessary for connecting to the remote computer to have admin privileges.
      If possible please can you send me the code.

      thnaks
      prasad

      Comment

      Working...