You can use the Command Prompt or the Get-Service PowerShell cmdlet to generate a list of Running or Stopped Windows Services. This post will show you how you can generate a list of Windows Services running on your Windows 11/10 computer using Command Prompt or PowerShell.
How to list all Windows Services using command line
We have already seen how to export a list of Running, Stopped, and Disabled Services using Services Snap-in or ServiWin tool; now, let us see how to do it using the command line.
Export Windows Services list using command line in CMD
Open an elevated Command Prompt, type the following and hit Enter:
sc query type= service > "%userprofile%\Desktop\ServicesList.txt"
This will save the list as a text file on your Desktop.
Use PowerShell to generate a list of Windows Services
The Get-Service cmdlet is designed to retrieve information about the services installed on your computer. Using the Get-Service PowerShell cmdlet, you can generate a list of Windows Services running on your Windows 10/8/7 computer.
Open an elevated PowerShell console, type Get-Service and hit Enter. You will see a list of all the Services installed on your Windows system.
You can also filter out the results using the filtering capabilities of Windows PowerShell. Make use of the parameters to achieve this. You can generate a list of Running Services as well as Stopped Services. You can also sort them by name using the Sort-Object cmdlet. You can go a step forward and even output the list to GridView.
For instance, you can use the Get-Service cmdlet, filter the status on the word Running, and then output to the GridView, by using the following command:
Get-Service | Where Status -eq "Running" | Out-GridView
This will generate a list of the Running Services, and another window will open to show the result.
To retrieve information about Stopped Services on a remote computer, and output it to GridView, use -ComputerName parameter, as shown below:
Get-Service -ComputerName RemoteComputerName | Where Status -eq "Stopped" | Out-GridView
To export the list of Windows Services, use the following command:
Get-Service | Where-Object {$_.Status -eq "Running"} | Out-File -filepath "$Env:userprofile\Desktop\ServicesList.txt"
This will save the list as a text file on your Desktop.
These were just three examples. Read more about Get-Service on TechNet.
Now take a look at how to Export and Backup Device Drivers in Windows using PowerShell.
How to get list of Windows services from command line?
If you want to obtain a list of Windows services from the Command line, you need to use the aforementioned guide. In other words, you can open the Command Prompt with administrator privileges first. Then, you can enter this command: sc query type= service > “%userprofile%\Desktop\ServicesList.txt”. For your information, you can find a text file on your desktop.
How do I get Windows services in PowerShell script?
If you want to get Windows services in PowerShell, you can follow the guide mentioned earlier in this article. You can make use of the Get-Service cmdlet to get it done. However, you can customize the command as per your requirements. For example, you can use this command to find the running process only: Get-Service | Where Status -eq “Running” | Out-GridView.
Using Windows PowerShell, you can also update Windows Defender definitions, list Drives, uninstall Universal apps, find scheduled tasks queued status, create System Image, create a desktop shortcut to open Windows Store apps, get an Installed Driver list, export Drivers, and more!
PatSG says
The 2 commands (see below) suggested by the TWC article both give an error on my Win 7 SP1 machine:-
Get-Service | Where Status -eq "Running" | Out-GridView
Get-Service -ComputerName RemoteComputerName | Where Status -eq "Stopped" | Out-GridView
I tried the following instead, & they work fine:-
Get-service | where-object {$_.Status -eq "Running"} | Out-GridView
OR:
Get-service | ? {$_.Status -eq "Running"} | Out-GridView
Get-Service -ComputerName RemoteComputerName | where-object {$_.Status -eq "Stopped"} | Out-GridView
OR:
Get-Service -ComputerName RemoteComputerName | ? {$_.Status -eq "Stopped"} | Out-GridView