Share via

Task Scheduller jobs monitor

RaavanSuraj 6 Reputation points
2021-07-02T14:32:29.43+00:00

Hi Everyone,

I have a Development server(For example GFDKGNKD ) in that ,I have more than 50 TASK SCHEDULER jobs run every day ,Need to monitor jobs status like fail or success .If any job fails needs to get email notification to the users about the failed job. Is there any PowerShell script to monitor fail jobs and email notification sending ?

Appreciate your help

Thank you

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

1 answer

Sort by: Most helpful
  1. Rich Matheisen 48,116 Reputation points
    2021-07-02T15:20:39.077+00:00

    You can use the Get-ScheduledTask and Get-ScheduledTaskInfo cmdlets for this:

    $x = Get-ScheduledTask | Get-ScheduledTaskInfo
    

    For each task you'll get an object with these properties:

    LastRunTime        : 7/2/2021 10:53:53 AM
    LastTaskResult     : 0
    NextRunTime        : 7/2/2021 5:00:00 PM
    NumberOfMissedRuns : 0
    TaskName           : Adobe Acrobat Update Task
    TaskPath           : \
    PSComputerName     :
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.