Get-StoppedAutoServices
$regBase = 'HKLM:\SYSTEM\CurrentControlSet\Services'
Get-CimInstance Win32_Service -Filter "StartMode='Auto' AND State='Stopped'" |
ForEach-Object {
$delayed = (Get-ItemProperty -Path "$regBase\$($_.Name)" -Name DelayedAutoStart -ErrorAction SilentlyContinue).DelayedAutoStart
[PSCustomObject]@{
Name = $_.Name
DisplayName = $_.DisplayName
StartupType = if ($delayed -eq 1) { 'Automatic (Delayed Start)' } else { 'Automatic' }
State = $_.State
}
}
Name DisplayName StartupType State
---- ----------- ----------- -----
xxxxxxxx xxxxxxxxxxxxx Automatic Stopped
xxxxxxxx xxxxxxxxxxxxx Automatic (Delayed Start) Stopped
xxxxxxxx xxxxxxxxxxxxx Automatic Stopped
xxxxxxxx xxxxxxxxxxxxx Automatic (Delayed Start) Stopped
xxxxxxxx xxxxxxxxxxxxx Automatic Stopped