<<

Take advantage of Vista's Event Viewer Version 1.0 and Task Scheduler integration August 6, 2008

By Greg Shultz

The EventTriggers in Windows XP would allow you to configure your system to provide notifications when certain events were recorded in one of the 's log files. While this was an extremely handy command to have in your troubleshooting arsenal, the fact that it was a command line tool that had to be configured with a bewildering number of special parameters made using it a bit daunting. However, if you were able to master and use the EventTriggers command in Windows XP, chances are that you really appreciated the convenience that it provided. If you have moved to , you may have shelled out to a command prompt and attempted to run the EventTriggers command. If you have, you have undoubtedly discovered that the EventTriggers command is not included with Vista. The reason that Microsoft removed the EventTriggers command from Vista is because they have replaced it with a totally new mechanism that integrates Task Scheduler with Event Viewer such that you can now attach a task directly to the event and then configure the task to perform any one of several operations whenever the event occurs and is logged in Event Viewer. In this edition of the Windows Vista Report, I'll show you how to take advantage of this new this Event Viewer and Task Scheduler integration feature.

Getting started To begin, right click on the Computer icon and select the Manage command. When the Computer Management window appears, locate and open the Event Viewer branch in the Console . Then, open the log that contains the event that you want to keep tabs on. Once you locate the event, simply right-click on it and select the Attach Task To This Event command as shown in Figure A.

Figure A

When you right click on any event, you'll see that the context menu allows you to associate the event with a task.

Page 1 Copyright ©2008 CBS Interacitve. All rights reserved. For downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com. Take advantage of Vista's Event Viewer and Task Scheduler integration

You'll then see the Create Basic Task wizard, as shown in Figure B. As you can see, this is pretty much the same wizard that Task Scheduler provides except that it is specifically targeted on events in Event Viewer. this point, you can provide a name for the task as well as a detailed description.

Figure B

A version of Task Scheduler's Create a Basic Task wizard appears that is targeted on the event you selected. When you click Next, you'll see the When a Specific Event Is Logged screen, as shown in Figure C. Since the task is already targeted on the event that you selected, there are no that you can configure on this page, simply click the Next button.

Page 2 Copyright ©2008 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com. Take advantage of Vista's Event Viewer and Task Scheduler integration

Figure C

The settings on this part of the wizard are preconfigured. You'll now see the Action screen, as shown in Figure D, and can choose from one of the three actions displayed. As you can see, you can a program, Send an e-, or Display a message.

Figure D

There are three actions that you can associate with the event in question.

Page 3 Copyright ©2008 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com. Take advantage of Vista's Event Viewer and Task Scheduler integration

Start a program If you select the Start a program option and then click Next, you'll see the Start a Program screen, as shown in Figure E. You can click the Browse button and then locate and select any executable file, a batch file, or a script. If you're running a command line tool, you can specify any parameters in the Add Arguments text box. You can even specify the directory in which you want the program to launch in the Start In text box.

Figure E

You can have the task run any executable file, batch file, or even a script. When you click Next, you'll see the Summary screen, as shown in Figure F, which lists all the details about the task that you just created. If you want to see the Properties dialog box for the task, be sure to select the check box.

Figure F

The Summary screen allows you to double check your settings before you commit.

Page 4 Copyright ©2008 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com. Take advantage of Vista's Event Viewer and Task Scheduler integration

When you click Finish, you'll see an informational message box like the one shown in Figure G. As you can see, this message tells you that the Event Task that you just created is stored in Task Scheduler and that if you want to alter the task, you can do so from within Task Scheduler. How's that for integration?

Figure G

The Event Task is stored and can be altered in Task Scheduler.

Send an e-mail Now, if you select the Send an e-mail option and then click Next, you'll see the Send an E-mail screen, as shown in Figure H. As you can see, everything that you would need to compose a message in an e-mail is just where you would expect. You can even add an attachment if you want!

Figure H

Everything that you would expect in an e-mail client's compose a message window is available here. At the very bottom you can specify the name of the SMTP to use to send the e-mail.

Page 5 Copyright ©2008 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com. Take advantage of Vista's Event Viewer and Task Scheduler integration

Display a message If you select the Display a message option and then click Next, you'll see the Display a Message screen, as shown in Figure I. As you can imagine, this feature allows you to essentially create your own warning dialog box. You simply give it a and as detailed a massage as you want.

Figure I

You can now give those silent and often deadly events a real voice with a custom message box. If you've ever looked through the Event Viewer logs and discovered a dangerous event occurring at regular intervals but that you'd never know about unless you looked in Event Viewer, then you will immediately recognize the benefit of the Display a message option. Now, you can give those silent and often "deadly over if left unattended" events a real voice.

Page 6 Copyright ©2008 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com. Take advantage of Vista's Event Viewer and Task Scheduler integration

Additional resources TechRepublic's Downloads RSS Feed Sign up for TechRepublic's Downloads Weekly Update newsletter Check out all of TechRepublic's free newsletters

Version history Version: 1.0 Published: August 6, 2008

Tell us what you think

TechRepublic downloads are designed to you get your job done as painlessly and effectively as possible. Because we're continually looking for ways to improve the usefulness of these tools, we need your feedback. Please take a minute to drop us a line and tell us how well this download worked for you and offer your suggestions for improvement.

Thanks!

—The TechRepublic Downloads Team

Page 7 Copyright ©2008 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://downloads.techrepublic.com.