472,127 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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 6554
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.