Get-Service StartupType
If you want to find out startup type of a service using Get-Service cmdlet, you are out of luck. Get-Service cmdlet does not have StartupType property. Set-Service however does. So how can you find out the startup type of a service using powershell?
You can use Get-WmiObject.
(Get-WmiObject Win32_Service -filter "Name='W32Time'").StartMode
Once you determine the startup type of desired service, you can change it using Set-Service cmdlet:
Set-Service W32Time -StartupType Manual
Thanks. very helpful
I wrote a powershell script that helps you query startup type of multiple services from multiple remote computers. Posting the link here.
http://techibee.com/powershell/how-to-query-service-startup-type-using-powershell/1774
In your comments you state “from multiple remote computers. Am I overlooking that part?
The comment about multiple remote computers is from techibee.com, not myself. I didn’t have any input in that script, neither do I endorse it. Feel free to check out their script and use it as you see fit.
There is an extra space in the last code block. It should be
-StartupType. No space after the hyphen.
Thanks Pat. Fixed now.