Do you want to Start or stop Windows service using Powershell? This post explains how to manage any Windows service with the help of the PowerShell cmdlets ‘Start-Service’, ‘Stop-Service’ and ‘Restart-Service’
Stop Windows service using PowerShell
Run the following steps to stop a Windows service
- Open powershell with admin privileges. You can do this by running ‘powershell’ command from elevated administrator command prompt
- Run the command below to stop a service
stop-service serviceCode
- Powershell command ‘get-service’ can be used to confirm if the service was stopped or not.
Start service using PowerShell
- Run powershell with admin privilges
- Run the start-service command
start-service serviceName
Great, thanks :D
The more useful command for me is restart service.
Details found here: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-service?view=powershell-7.1
Example to restart LMI (LogMeIn) services from the remoter powershell console:
Restart-Service -Name LogMeIn
If I were to simply stop the service, I would be locked out… I required a single command to stop and start (restart) the service so that I was able to connect to the GUI level of LMI.
Hope this helps someone else. Take care!