4 Ways to Start, Stop Services on A Remote Windows Computer

1

Restarting a service is quite a common task to any system administrators, whether on a local system or a remote computer. Now let’s take look a number of ways how to start, stop, and restart a service on a remote computer.

How to get the name of a service

Before we dive into the ways to operate remote service, let’s check how to get the proper the name of the service first because it will be used by any command or PowerShell cmdlet listed below.

One thing worth pointing out is that the names listed in Name column in Services MMC are not the service name used in the command lines below. They are just the Display Name of the services. You will need to open the service properties dialog to find out.

Service name dialog - 4 Ways to Start, Stop Services on A Remote Windows Computer

SC

It’s a built-in command line since Windows XP. It interacts with local and remote services quite easily like this:

SC \\computername STOP servicename
SC \\computername START servicename

You can put these commands in a batch file and run it as a login script or a scheduled task.

If you know the name of the service you want to interactive, SC is pretty to deal with. However, it doesn’t work well with those services that have dependent services to rely on.

One thing to note that SC doesn’t have the option to restart the service. So if you need to restart a remote service, you will need to do STOP and START separately.

By the way, you can use SC to get the name of the service, like below:

SC GetKeyName "service display name"

SC command to get the name of the service - 4 Ways to Start, Stop Services on A Remote Windows Computer

PSService from Sysinternals

If you are a fan of Windows Sysinternals, you can use PSService.exe that works similar to SC and does get the job done as well. It does include a switch that can restart the service.

psservice \\computername restart service

But it still doesn’t handle the service with the dependencies well.

c 20111003b Remote Desktop Connection 2016 02 28 23 40 34 - 4 Ways to Start, Stop Services on A Remote Windows Computer

PowerShell

There are multiple ways to deal with services using PowerShell. But the following scripts seem to be the easiest ways to me.

Get-Service -ComputerName computername -Name servicename | Restart-Service -Force
Get-Service -ComputerName computername -Name servicename | Stop-Service -Force
Get-Service -ComputerName computername -Name servicename | Start-Service

The -Force parameter here is to deal with the service with the dependencies.

Basically, the Get-Service cmdlet with -ComputerName returns an object reference to the service in the question. And then pipe the result to Start-Service, Stop-Service, or Restart-Service to perform the respective actions.

You can also throw in the Test-Connection cmdlet in the script to test the remote connection before querying the service.

Service Manager MMC

And of course, we can always use the built-in Service Manager MMC (services.msc) to perform the job as well. To connect to a remote services MMC, click the Services name in the left pane, go to Action, then Connect to another computer…

Services connect to another computer - 4 Ways to Start, Stop Services on A Remote Windows Computer

Once connected, you can operate the services just like you do on the local system.

Was this article Helpful?

Thank you for the feedback!

1 COMMENT

  1. Here is another additional example of using PowerShell that adds the ability to start services on multiple computers at a time (from computer list in text file): http://www.action1.com/kb/list_of_services_on_remote_computer.html

    If you don’t mind a shameless plug, here at Action1 we created a free cloud-based service that can start or stop services remotely on multiple computers, as long as they are connected to Action1 cloud: https://www.action1.com/p/Free-Start-Windows-Service-Remotely-80.html

LEAVE A REPLY

Please enter your comment!
Please enter your name here