Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



VB script for monitor the scheduled tasks and send Email notificat

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-05-2008
Wendy
 
Posts: n/a
VB script for monitor the scheduled tasks and send Email notificat

Any idea about how to write a VB script to monitor the scheduled tasks and
send an email notification if a scheduled task does not complete
successfully. This is for Windows 2003 server.

Thanks.

Wendy

Reply With Quote
  #2  
Old 22-05-2008
Pegasus \(MVP\)
 
Posts: n/a
Re: VB script for monitor the scheduled tasks and send Email notificat


"Wendy" <Wendy@discussions.microsoft.com> wrote in message
news:7072D987-21C0-48C8-A576-45863DC8DC1A@microsoft.com...
> Any idea about how to write a VB script to monitor the scheduled tasks and
> send an email notification if a scheduled task does not complete
> successfully. This is for Windows 2003 server.
>
> Thanks.
>
> Wendy
>


Here are a couple of options:
- Check the ErrorLevel of each command executed by your
scheduled task, then use blat.exe (downloadable from many
sites) do generate a notification EMail to yourself.
- Use the Task Scheduler to run this batch file once every
few hours:
01. @echo off
02. for /F "delims=" %%a in ('schtasks /query /v /fo:list ^| findstr /i
"Taskname Result"') do call :Sub %%a
03. goto :eof
04.
05. :Sub
06. set Line=%*
07. set BOL=%Line:~0,4%
08. set MOL=%Line:~38%
09. if /i %BOL%==Task (
10. set name=%MOL%
11. goto :eof
12. )
13. set result=%MOL%
14. echo Task Name=%name%, Task Result=%result%
15. if not %result%==0 (
16. echo Task %name% failed
17. echo blat.exe .. .. ..
18. )


Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VB script for monitor the scheduled tasks and send Email notificat"
Thread Thread Starter Forum Replies Last Post
Script for identifying Account to expire within X-Days then send notification email with list of users kevinguo Windows Server Help 5 02-11-2009 08:28 PM
Windows Scheduled Tasks don't luanch if tasks not finished Andy Candy Windows Software 3 21-08-2009 11:47 AM
Scheduled Tasks: Notify me of missed tasks Swifty Windows XP Support 2 02-01-2009 02:45 PM
Scheduled Tasks Starfish Small Business Server 2 07-10-2008 03:50 PM
Where are kept Scheduled tasks? Jack Vista Help 8 18-01-2008 01:28 AM


All times are GMT +5.5. The time now is 04:01 PM.