I am not a PS guru, hence the request. I have a scenario to check all windows service on a window host that are set for automatic startup, however are not started for whatever reason.
I have a programming background, however just not PS syntax friendly. I have gathered these two pieces and need to put them in a PS script that is PS v4 or higher.
Get-wmiobject win32_service -Filter “startmode = ‘auto’ AND state != ‘running’ AND Exitcode !=0 ” -ComputerName sql1 | select name, startname, exitcode