Hi Team,
I created script to check the service with set to automatic by default and all running.
but i tried to stopped one of the service and verify.
and when i run my script it show " "All Auto Services are running!Yes"
and it doesn't display the servicename with stopped status.
see below my script if there is need to add:(
Text
$serviceauto=Get-WmiObject win32_service |
Where-Object {$_.Startmode -eq "Auto"}|select Name,Startmode,State
if (!($serviceauto.state -eq "Running"))
{write-host "Please check $serviceauto.name"
}
else
{ write-host
"All Auto Services are running!Yes
}
Thanks