How To Start Or Stop Services On Remote Windows 10 Pc
Restarting a service is quite a common task to any organization administrators, whether on a local system or a remote computer. At present allow'due south take look a number of means how to start, stop, and restart a service on a remote estimator.
How to get the name of a service
Before we dive into the means to operate remote service, let's cheque how to become the proper the name of the service first because it will be used past any control or PowerShell cmdlet listed below.
1 thing worth pointing out is that the names listed in Name column in Services MMC are non the service name used in the command lines below. They are just the Brandish Name of the services. You volition need to open the service properties dialog to detect out.
SC
It's a built-in command line since Windows XP. Information technology interacts with local and remote services quite easily like this:
SC \\computername STOP servicename SC \\computername Offset servicename
You tin can put these commands in a batch file and run it equally a login script or a scheduled task.
If y'all know the proper noun of the service you want to interactive, SC is pretty to deal with. However, it doesn't piece of work well with those services that have dependent services to rely on.
One thing to note that SC doesn't accept the choice to restart the service. So if you need to restart a remote service, yous volition need to practice STOP and START separately.
By the manner, you can utilize SC to get the name of the service, like below:
SC GetKeyName "service display name"
PSService from Sysinternals
If you lot are a fan of Windows Sysinternals, you can use PSService.exe that works similar to SC and does get the job done as well. Information technology does include a switch that tin can restart the service.
psservice \\computername restart service
But it all the same doesn't handle the service with the dependencies well.
PowerShell
In that location are multiple ways to bargain with services using PowerShell. Only the following scripts seem to exist the easiest means to me.
Go-Service -ComputerName computername -Name servicename | Restart-Service -Strength Get-Service -ComputerName computername -Name servicename | Cease-Service -Forcefulness Become-Service -ComputerName computername -Name servicename | Start-Service
The -Force parameter here is to bargain with the service with the dependencies.
Basically, the Get-Service cmdlet with -ComputerName returns an object reference to the service in the question. So pipe the upshot to Beginning-Service, Stop-Service, or Restart-Service to perform the respective actions.
Yous tin as well throw in theTest-Connectioncmdlet in the script to examination the remote connection before querying the service.
Service Managing director MMC
And of class, we tin always use the congenital-in Service Manager MMC (services.msc) to perform the job as well. To connect to a remote services MMC, click the Services proper noun in the left pane, go to Activity, then Connect to another computer…
Once connected, yous can operate the services just similar you do on the local system.
How To Start Or Stop Services On Remote Windows 10 Pc,
Source: https://www.nextofwindows.com/4-ways-to-start-stop-services-on-a-remote-windows-computer
Posted by: griffinbaccupon.blogspot.com
0 Response to "How To Start Or Stop Services On Remote Windows 10 Pc"
Post a Comment