Can I (How can I) remotely start and stop a Windows Service running on another server from the command line?

My server is running Windows Server 2003.

link|improve this question

75% accept rate
feedback

1 Answer

up vote 10 down vote accepted

Sure thing. Provided you're logged-on with an account that has "Administrator" rights on the remote server, just do:

sc \\remote-server stop service-name

and

sc \\remote-server start service-name

The sc command runs asynchronously to the service control manager, so you may want to query the service with the command below to insure it actually stopped before you try to start it again:

sc \\remote-server query service-name
link|improve this answer
Thank you. That was exactly what I wanted. – Rising Star Jul 6 '10 at 19:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.