How do I extract a list of Windows services and their status to a text file?

18

12

I would like to get a text dump of the screen you see when running services.msc (except the Description column). This is so I can run a diff after installing different software that adds services to this screen.

Is this possible?

If it's helpful I have access to Powershell but don't know how to retrieve this type of information from it.

Alex Angas

Posted 2010-05-25T06:24:16.177

Reputation: 2 210

Answers

19

In the Services window, Action > Export... menu can give you the list as a .txt or .csv file. It gives you the description column as well, but you can easily delete it using a program like Excel.

You can also do this from Powershell.

Get-Service | Export-Csv -path "C:\services.csv"

Besides, you can filter the list. For example, you can get only the started services by executing the following command:

Get-Service | where {$_.Status -eq "Running"} | Export-Csv -path "C:\services.csv"

Mehper C. Palavuzlar

Posted 2010-05-25T06:24:16.177

Reputation: 51 093

This seems to only get my user's services or something. I have some services that aren't showing up in this list? – Alex K – 2014-12-01T18:51:17.360

1If export with .csv, ensure Unicode Text (Tab Delimited) (*.txt) is used. If use Comma Delimited, the comma in Description field may overflow and mess up the output. – Ivan Chau – 2016-07-10T10:59:52.967

2

found here a way to export and import the configuration: http://www.winhelponline.com/blog/backup-windows-services-configuration/

– JinSnow – 2016-08-20T14:51:11.547

12

Without using powershell, this lists running services:

 sc query > running_services.txt

This lists all services, running or not:

 sc query state= all > all_services.txt

Warren P

Posted 2010-05-25T06:24:16.177

Reputation: 2 623

1PowerShell works better in this case because its output can be easily customised. But it's good to know there are other options, thanks! – Alex Angas – 2011-07-14T22:50:08.447

1PowerShell is nice, but not always on every machine. – Warren P – 2011-08-03T15:33:37.907

Apparently WMI can do this too. – Warren P – 2011-11-01T17:23:59.690

5

You can also use net start to get the list of the running services.

Emmanuel Bourg

Posted 2010-05-25T06:24:16.177

Reputation: 221

3

I also needed the full path, so I wound up using

Get-WmiObject win32_service | select Name, DisplayName, State, PathName | Export-Csv -path "C:\services.csv"

Xan-Kun Clark-Davis

Posted 2010-05-25T06:24:16.177

Reputation: 397

0

On the server 8 (2012 beta), The Export option is gone.

Also the start menu is gone, and there's only a link to powershell on the taskbar. Thankfully all the programs are still there, I just had to manually create shortcuts to each one.

Justin Goldberg

Posted 2010-05-25T06:24:16.177

Reputation: 434

1On Server 2012 R2, there exists option: Action -> Export List... – Ivan Chau – 2016-07-10T10:41:39.133