Windows Service "Startup" type not a property of get-service

This topic contains 3 replies, has 2 voices, and was last updated by  Hassan MS 2 years, 4 months ago.

  • Author
    Posts
  • #26410

    Hassan MS
    Participant

    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?

  • #26411

    Jeremie Lauzier
    Participant

    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 !

  • #26412

    Jeremie Lauzier
    Participant

    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'"

  • #26512

    Hassan MS
    Participant

    Thank you

You must be logged in to reply to this topic.