Task Scheduller jobs monitor

RaavanSuraj 6 Reputation points

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 Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,763 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 36,331 Reputation points

    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     :