Start and Stop service on remote server programatically

C

Chris Dunaway

I need to be able to start and stop a service on another computer on
the network. But I cannot connect to the other computer using my
standard user credentials. I have a separate login for that for which
I use Remote Desktop to connect to the other machine.

The other machine is a test server where my Windows Service application
is running. It is an inconvenience to have to connect through Remote
Desktop just to start and stop the service.

I would like to create a small app with a single button that I can use
to simply stop the service and start it as needed.

How can I connect to the remote machine using the appropriate
credentials programatically so that my program impersonates the correct
user account on the other machine?

Thanks,
 
G

Guest

Check out the System.ServiceProcess.ServiceController. It is designed for
what you want.
 
C

Chris Dunaway

Yes, I am familiar with that part. What is not apparent is how to
impersonate a different user on the remote machine. I have figured
that out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top