469,628 Members | 1,049 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Start and Stop service on remote server programatically

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,

Jan 30 '06 #1
2 6413
Check out the System.ServiceProcess.ServiceController. It is designed for
what you want.

"Chris Dunaway" wrote:
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,

Jan 30 '06 #2
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.

Jan 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mark | last post: by
4 posts views Thread by vickaiser1 | last post: by
16 posts views Thread by Serdar Kalaycý | last post: by
reply views Thread by louise.kelly | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.