PowerTip: Find the Start Mode and Startup Account for Services

PowerTip: Find the Start Mode and Startup Account for Services

  • Comments 3
  • Likes

Summary: Use Windows PowerShell to find the start mode and startup account used by services.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the startup account and the start mode of services on my system?

Hey, Scripting Guy! Answer You need to use WMI and query the Win32_Service class.

With Windows PowerShell 3.0, use the Get-CimInstance cmdlet, as shown here.

PS C:\> Get-CimInstance -ClassName win32_service -Property startmode, startname, name |

  select startname, startmode, name

With Windows PowerShell 1.0 and 2.0, use the Get-WmiObject cmdlet to query the Win32_Service WMI class, as shown here.

PS C:\> Get-WmiObject -Class win32_service -Property startmode, startname | select st

artname, startmode, name

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • The sample commands above seem to be missing the third parameter "name" prior to the pipe operator.

    PS C:\> Get-WmiObject -Class win32_service -Property startmode, startname, name | select startname, startmode, name

    Adding that parameter enabled the column to be populated with the ServiceName as desired.

    startname                                startmode                                name                                    

    ---------                                ---------                                ----                                    

    LocalSystem                              Disabled                                 AdobeFlashPlayerUpdateSvc              

    NT AUTHORITY\LocalService       Disabled                                 Alerter                                

    NT AUTHORITY\LocalService       Manual                                   ALG                                    

    LocalSystem                              Auto                                     AMPAgent

  • @David Kirchmer - GDS you are right. I updated the code so that it works. Thanks for the catch.

  • The 'name' parameter is still missing for the 1.0 and 2.0 Powershell example.