How to Start,Stop windows services using Powershell?

By |2018-10-05T16:24:48+00:00October 5th, 2018|Categories: HowTo, Windows|Tags: , , |0 Comments

Windows PowerShell is a Powerful tool which is developed by Microsoft for purposes of task automation and configuration management. This is based on the .NET framework and it includes a command-line shell and a scripting language. Windows PowerShell is designed especially for system administrator. If you are a windows administrator and if you know PowerShell very well and you can simplify and automate tedious and repetitive tasks by creating scripts and combining multiple commands together.

This article shows how to start or stop windows services using PowerShell.

First open PowerShell in elevated mode. In windows 10 you can press windows + X and select Windows PowerShell admin.

Now you have to get the service name before proceeding to start or stop. How to get the all the Windows services using PowerShell.

Type Get-Service in the PowerShell window this will List out all the services.

Example: Get-Service

Get Services-windows services using Powershell

This command will list out all the running and stopped services together. You can get the service names in the List.

To separate the stopped and running service you can type the below mentioned command.

Get-Service | Where {$_.status –eq ‘running’} –>this command will show all the running services

Running Services-windows services using Powershell

Get-Service | Where {$_.status –eq ‘Stopped’} –>this command will show all the Stopped services

Stopped Services-windows services using Powershell

Now you can choose the service name to start or stop.

To start a windows service type, Start-Service “Service name”

Example: Start-Service Spooler

To stop a windows service type Stop-Service “Service name”

Example: Stop-Service Spooler

If you want to know any windows services details you can type the below mentioned command.

Get-Service “Service name” | Select-object *

Example: Get-Service Spooler | select-Object *

Get Services Details-windows services using Powershell

This command will get the service named printer spooler and it shows all the object details. * indicates all the object. If you want to show any individual Object you can type the object name instead of *.

Example: Get-Service Spooler | select-Object DisplayName

Get Services Details-windows services using Powershell

I think this might be helpful.

 

About the Author:

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies and third party services. Cookies help us deliver our services. By using our services, you agree to our use of cookies. Read More Ok