I recently discovered that Windows 10 adds a DelayedAutoStart property to the Win32_Service WMI Class:
Get-CimInstance -ClassName Win32_Service -Filter "Name = 'MapsBroker'" | Format-List -Property *
I’ve verified that this property does not exist on prior operating systems such as Windows 8.1 even when they’re updated to the production preview version of PowerShell version 5.
I had written a Hey, Scripting Guy! Blog article on how to query the registry of remote machines to Exclude Delayed Start Services when Checking Status with PowerShell that shows how to retrieve the necessary information to accomplish this task on other OS’s, but it’s nice to see that Microsoft has finally made this information easier to retrieve.
Previously you would have only been able to narrow the services down to the ones that were set to start automatically and weren’t running with the Win32_Service WMI class, but without a way of excluding the DelayedAutoStart ones short of querying the registry:
Get-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Auto' and State != 'Running'" | Select-Object -Property State, Name, DisplayName, DelayedAutoStart
Now with this new property, the task of excluding the DelayedAutoStart ones is easy:
Get-CimInstance -ClassName Win32_Service -Filter "StartMode = 'Auto' and DelayedAutoStart = 'False' and State != 'Running'" | Select-Object -Property State, Name, DisplayName, DelayedAutoStart