Author Posts

June 13, 2015 at 7:21 am

Hi,
I am just wondering if I am doing something wrong or this is true that Get-service cmdlet does not have "Startup type" as the Property (member type) –
see
Get-service -name "service name" | gm

CanPauseAndContinue Property
CanShutdown Property
CanStop Property
Container Property
DependentServices Property
DisplayName Property
MachineName Property
ServiceHandle Property
ServiceName Property
ServicesDependedOn Property
ServiceType Property
Site Property
Status Property

so how can I find out the startup type of a Windows service using PowerShell get-service?
is there another cmdlet or name that does the job?

June 13, 2015 at 7:42 am

Hi,

Get-Service does not have an option to find the startup type.
But you can use this :

Get-WmiObject -Class Win32_Service -Property StartMode -Filter "Name='ServiceName'"

Have a good day !

June 13, 2015 at 7:43 am

Sorry, my previous post didn't go well. And I don't have the Edit button so...

This is the command : Get-WmiObject -Class Win32_Service -Property StartMode -Filter "Name='ServiceName'"

May 16, 2018 at 1:59 am

This should give startup mode of all services;

Get-CimInstance -ClassName Win32_Service | Where-Object startmode -EQ 'Auto' | FT Displayname, name, startmode, started -AutoSize

For troubleshooting, often we need to determine services whose startup-mode is 'Automatic' but are not running. The following command will do this;

Get-CimInstance -ClassName Win32_Service | Where-Object startmode -EQ 'Auto' | FT Displayname, name, startmode, started -AutoSize | Findstr /c:"started" /c:"False"