List service name and Command Line

If you need to get the command line of a service, you will find that the Get-Service cmdlet is not sufficient.

Use the below to obtain the name, displayname and command line of the Telephony service from a remote system.

Note: to change the remote server, modify the <server> section, to change the service to be retrieved, modify the *tapi*, or remove the ?{$_.Name -like '*tapi*'} | section to list all services.

Also, keep in mind, the DisplayName is what is seen in the services mmc main page, the name is the name as listed in the service properties page in the services mmc.

 Get-WmiObject -computername <server> win32_service | ?{$_.Name -like '*tapi*'} | select Name, DisplayName, @{Name="Path"; Expression={$_.PathName}} | Ft

Leave a Reply