5 Replies Latest reply on Mar 31, 2015 5:40 AM by jeremyxmentzell

    Windows Scheduled Tasks Failure Report - with custom properties?


      There is a SWEET canned report for failed scheduled tasks - here's the rub - I'm going to be picky.

      I have custom properties for what engineers attend to what nodes specifically that I want to populate in this report so I can go "Hey Erlich, your defrag task isn't running!" Or when I get really fancy it'll just e-mail it to them.


      Here's the logic from the canned web report - I'm just not sure where/how to insert the selection of those properties OR if that's even the right place to do it; should I be re-engineering the report? - Thoughts? Too picky?


      "SELECT n.Caption, n.DetailsUrl, n.Status, n.ChildStatus, t.Name, t.State, t.LastRunResult, ToLocal(t.LastRunTime) AS LastRunTime, ToLocal(t.DateOfCreation) AS DateOfCreation, t.Author

      FROM Orion.APM.Wstm.Task t

      INNER JOIN Orion.Nodes n ON t.NodeID = n.NodeID

      WHERE t.LastRunResult NOT IN (

          0,       -- The task is ready to run at its next scheduled time. --

          267009,  -- The task is currently running. --

          267010,  -- The task will not run at the scheduled times because it has been disabled. --

          267011,  -- The task has not yet run. --

          267012,  -- There are no more runs scheduled for this task. --

          267013,  -- One or more of the properties that are needed to run this task on a schedule have not been set. --

          267014,  -- The last run of the task was terminated by the user. --

          267015,  -- Either the task has no triggers or the existing triggers are disabled or not set. --

          267016,  -- Event triggers do not have set run times. --

          267035,  -- The task is registered, but not all specified triggers will start the task. --

          267036,  -- The task is registered, but may fail to start. Batch logon privilege needs to be enabled for the task principal. --

          267045   -- The Task Scheduler service has asked the task to run. --