Login | |
|
 |
RE: notification - 11/26/2007 2:38:16 PM
|
|
 |
|
| |
dm_4ever
Posts: 2635
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
Have you taken a look at schtasks which is available on WinXP and greater? It allows you to query scheduled task on local and remote machines and it will show you the last run time and last result code (0 if successful). I'd suggest you play with finding the correct syntax for it and then output to a text file or read it directly using the shell object. Some parsing will be necessary, but get started with that and post what you have so we can help you achieve your goal.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: notification - 11/26/2007 4:05:52 PM
|
|
 |
|
| |
dm_4ever
Posts: 2635
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
quote:
The Win32_ScheduledJob WMI class represents a job created with the AT command. The Win32_ScheduledJob class does not represent a job created with the Scheduled Task Wizard from the Control Panel. You cannot change a task created by WMI in the Scheduled Tasks UI. Like I said...take a look at schtasks....i.e. SCHTASKS /QUERY /FO LIST /V /S ComputerName
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: notification - 11/27/2007 8:08:44 AM
|
|
 |
|
| |
abenitez77
Posts: 5
Score: 0
Joined: 10/8/2007
Status: offline
|
Thanks...I ran SCHTASKS /QUERY /FO LIST /V /S ComputerName > c:\tasks.txt It exported all my tasks to a txt file. I want to have a script I can run that will only show me the jobs that failed from my 3 servers that have scheduled tasks. I don't want to go thru the text files every day to find out there were no failed jobs. Is it possible to get a script to display just the failed jobs from the txt files? output from schtasks command: HostName: usman01srfs04 TaskName: HYE_CLAIMS Next Run Time: 19:10:00, 11/27/2007 Status: Last Run Time: 19:10:00, 11/26/2007 Last Result: 0 Creator: abenit01 Schedule: At 7:10 PM every Mon, Tue, Wed, Thu, Fri of every week, starting 10/3/2007 Task To Run: E:\Scans\CopyExe\HYE_CLAIMS.bat Start In: E:\Scans\CopyExe Comment: N/A Scheduled Task State: Enabled Scheduled Type: Weekly Start Time: 19:10:00 Start Date: 10/3/2007 End Date: N/A Days: MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY Months: N/A Run As User: AMER\SvcMan01Replication Delete Task If Not Rescheduled: Disabled Stop Task If Runs X Hours and X Mins: 24:0 Repeat: Every: Disabled Repeat: Until: Time: Disabled Repeat: Until: Duration: Disabled Repeat: Stop If Still Running: Disabled Idle Time: Disabled Power Management: No Start On Batteries, Stop On Battery Mode
|
|
| |
|
|
|
 |
RE: notification - 11/27/2007 9:26:15 AM
|
|
 |
|
| |
dm_4ever
Posts: 2635
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
Sure it is possible to create a script like the one you mentioned, but you need to start before we can help. Look at FileSystemObject to read the file from within a script and WSHShell to execute that command you came up with.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|