Create a script that has return 0 when working and return 1 for warning and 2 for failed
$events = get-scheduledtask | where {$_.State -ne "Disabled"} | where {((Get-ScheduledTaskInfo $_).LastTaskResult -ne "0") -and ((Get-ScheduledTaskInfo $_).LastTaskResult -ne "267009") -and ((Get-ScheduledTaskInfo $_).LastRunTime -ge ((Get-Date).AddHours(-48)) -and ((Get-ScheduledTaskInfo $_).TaskPath -notlike "\Microsoft\*" ))} | Select TaskName
$eventcounnt = ($events.TaskName).Count
if ($eventcounnt) {return 1} else {return 0}
Copy .ps1 file Labtech server C:\LTShare\Transfer\Montitors
Create a External EXE Check with the bat referenced with script in Exectutable
