Sometimes it is necessary to restart / stop / start the Windows service / service. For this purpose you can use built-in and third-party tools both on the command line and GUI options (e.g. SC, Psservice.exe, MMC).
This How-to describes different ways to Start or Stop Windows Service Remotely.
1. Using SC to Control Windows Services
The SC command is used to configure, query, stop, start, delete, and add system services on the Windows command line. Most of the SC command subcommands apply equally to drivers. If you have the appropriate permissions, the SC command can be used to manage services on both the local and remote systems.
Use this command to manage / poll service states,
SC can be used locally and remotely, remote polling of service status
sc \\computer query servicename
Also you can find out the type of service startup:
sc \\computer qc servicename
Stop or start the service:
sc \\computer start|stop servicename
Also you can change the type of service startup:
sc \\computer config servicename start=auto|demand|disabled
2. Using NET utility to Control Windows Services
The PsExec utility is part of the Sysinternals PsTools package. It allows you to run commands on remote computers and does not require installation in the system. To use the utility, simply copy it to the folder with executable files (eg C: \ Windows \ system32) and run it from any command line shell: Cmd or PowerShell.
Remotely this command can be used in conjunction with psexec.exe, from the PSTOOLS kit. Everything is simple here - we use the command remotely using psexec:
PsExec.exe \\computer net stop servicename && net start servicename
stop | start is used for start/stop the service
3. Using PowerShell to Control Windows Services
Start the Windows PoweShell console with administrative privileges. To get a list of services registered on the local computer, use the cmdlet:
To check status use command:
Get-Service -ComputerName computer -Name servicename
Perform the next actions to start, stop or restart services:
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
4. Using PsService.exe to Control Windows Services
PsService.exe is a command line utility for viewing and managing Windows services. PsService displays the status, configuration, and dependencies of services, and also allows you to start, pause, and restart them. The software allows you to log into the remote computer on behalf of another account in cases where the current account does not have the permissions necessary to access the remote system. The PsService utility includes a unique search function that allows you to detect active instances of a specified service on the network.
Included in the same set of PSTOOLS, this utility I liked most of all, the request for the status of the service:
PsService.exe \\computer query servicename
Use next command to view the configuration:
PsService.exe \\computer config servicename
To Start, stop, restart execute following
PsService.exe \\computer restart|stop|start servicename
Also you can configure service with help of command:
psservice \\computername -u admin -p pass setconfig servicename Auto|Disabled|Demand
5. Using MMC Snap to Control Windows Services
The Microsoft Management Console (MMC) is a place to store and display administration tools created by Microsoft and other software vendors. These tools are called snap-ins and are used to manage Windows hardware, software, and network components. Some of the tools located in the Administration folder, such as Computer Management, are MMC snap-ins.
To change the state of the service, to stop it, or to restart you will need to perform the following steps:
Also consider using Action1 to start Windows service remotely if: