Solved

Monitor Windows Scheduled Tasks Last Run Result

Posted on 2013-06-05
1
1,922 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Normally after a failure of Domain Controller, when promoting new DC the DC is renamed, we will discuss the options in Dcpromo to re-create the DC with the same name. Scenario: You are a small IT shop with two Domain Controllers (Domain Contr…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

809 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