Solved

Monitor Windows Scheduled Tasks Last Run Result

Posted on 2013-06-05
1
1,936 Views
Last Modified: 2013-06-05
I would like to set up some kind of alert that tells me when a task runs with a result and returns anything other than 0x0. Obviously if the scheduled task runs and the action returns an error code, the Task Scheduler still returns as successful so it's not possible to set up monitoring from the Event Viewer

My server is running Windows Server 2008 R2

How can I set up monitoring to check the Last Run Result?

Thanks in advance
0
Comment
Question by:bumbl
1 Comment
 

Accepted Solution

by:
bumbl earned 0 total points
ID: 39221382
I solved this issue with a PowerShell script. I found it here

http://serverfault.com/questions/436720/is-it-possible-for-a-powershell-script-to-return-the-last-run-result-from-window

$taskName = "ETL"
$result = (schtasks /query /FO LIST /V /TN $taskName | findstr "Result")
$result = $result.substring(12)
$lastResult = $result.trim()
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question