Solved

Monitor Windows Scheduled Tasks Last Run Result

Posted on 2013-06-05
1
1,973 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macrons on position are not showing correctly in Active Directory 4 44
UniFi MAC address filtering 2008 R2 13 107
Robocopy parameters. 6 45
Run Windows Server from USB 2 39
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…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
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…

726 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