How do I restart a service on a remote machine in Windows?

Josh Kodroff picture Josh Kodroff · Oct 9, 2008 · Viewed 430.3k times · Source

Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?

Answer

Vinko Vrsalovic picture Vinko Vrsalovic · Oct 9, 2008

You can use the services console, clicking on the left hand side and then selecting the "Connect to another computer" option in the Action menu.

If you wish to use the command line only, you can use

sc \\machine stop <service>