Get startup type of Windows service using PowerShell Get startup type of Windows service using PowerShell powershell powershell

Get startup type of Windows service using PowerShell


WMI is the way to do this.

Get-WmiObject -Query "Select StartMode From Win32_Service Where Name='winmgmt'"

Or

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


With PowerShell version 4:

You can run a command as given below:

   Get-Service | select -property name,starttype


In PowerShell you can use the command Set-Service:

Set-Service -Name Winmgmt -StartupType Manual

I haven't found a PowerShell command to view the startup type though. One would assume that the command Get-Service would provide that, but it doesn't seem to.