Logo
PREGNANCY
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Vista

Automating Vista Events

7/22/2013 5:54:33 PM

When you manage events, you often wish you could generate automatic actions when specific events occur. For example, it would be nice if you could automatically delete temporary files and send a notification to desktop technicians when PC disk drives get too full. Or, it would be nice if you could receive automatic notification when unauthorized users try to log on to workstations that contain access to highly sensitive or confidential information. Or even better, display a message telling users they are trying to access unauthorized systems and then send an e-mail to appropriate authorities. All of these things are now possible in Windows Vista.

Linking events to automated tasks is a very straightforward process. It can be done in one of three ways:

  • Through the Task Scheduler

  • Through the Event Viewer

  • Through the command line

When you create either a basic or an advanced task in the Task Scheduler, you can select an event as the trigger for the task. Use the following procedure:

  1. Create a new task from the Action menu. Choose Action => Create Task.

  2. Name the task and set the credentials under which the task will run.

  3. Move to the Trigger tab and click New. Select On an event as the task trigger from the drop-down list.

  4. Choose either Basic or Custom as the event setting.

    • Basic settings let you select which Event Log will be the source of the event, then which event source and finally, which event ID to look for.

    • Custom settings let you create an Event Filter, letting you determine exactly how the task should be launched based on a series of filtered conditions.

  5. Then continue adding the task properties such as conditions, actions, and settings.

It gets even better when you generate the task from the Event Viewer. Here you repeat much the same process, except that the task is generated from the event itself instead of the other way around.

When you create an automated task from the Event Viewer, use the following procedure:

  1. Locate the event to which you want to attach the task. You can either drill down to the event or create a filter to locate the event.

  2. Right-click on the event to select Attach Task To This Event or use the Action pane to click on the same command. This option automatically launches the Basic Task wizard.

  3. Run through the wizard's panes to generate the task.

The advantage of using this method to create the task is that it automatically fills in all of the information required to generate the trigger from the event. The disadvantage is that you can only create a basic task using this method. Of course, after the task is created, you can go to the Task Scheduler to add features and properties to the task, but this requires more steps to do so.

The last method is to use the command line to link a task to an event. To do so, you need the following values:

  • The Event Log from which the event is generated

  • The source of the event

  • The event ID

These values can be obtained either through the Event Viewer or through the wevtutil.exe command by using the proper switches. For example, you might use:

wevtutil qe Security /c:n /rd:true /f:text

This command would query the Security Event Log to obtain the latest events by reversing the list of events /rd:true and displaying then in text format /f:text as opposed to the default XML format. In this command line, the value for n should be a number indicating how many events you want returned by the command.

Then, after you have the values you need, you can use the Task Scheduler command to generate the task. For example, you might use:

schtasks /create /TN taskname /TR action /SC ONEVENT /EC System /
   MO *[System/EventID=IDnumber]

Where "taskname" is the name you want to assign to the task, "action" is the action to perform or command to execute, and "IDnumber" is the ID number of the event, which will act as a trigger for the task.

In this example, the source Event Log is the System log. The task schedule is based on the occurrence of the event and is modified to identify the event ID.

As you can see, the combination of the Event Log with the Task Scheduler opens the door for several system management activities. And, because Vista offers a much more detailed and rich event management structure, the possibilities are endless. Tasks can be generated on one machine and exported in XML format to be imported to any other system.

Other -----------------
- Exploring the Vista Task Scheduler
- Tracking Change in Vista : Turning on the audit policy, Exploring the Vista Event Log
- Managing Change through Group Policy (part 4) - Assigning PC-Related GPOs, Troubleshooting and monitoring Group Policy
- Managing Change through Group Policy (part 3) - Working with GPO tools
- Managing Change through Group Policy (part 2) - Working with central policies
- Managing Change through Group Policy (part 1) - Working with Local Policies
- Securing the Workstation : Applying the Castle Defense System (part 7) - Working with external access - Working with Public Key Infrastructures, Working with Virtual Private Network connections
- Securing the Workstation : Applying the Castle Defense System (part 6) - Working with external access - Working with the Windows Firewall with Advanced Security
- Securing the Workstation : Applying the Castle Defense System (part 5) - Managing information access
- Securing the Workstation : Applying the Castle Defense System (part 4) - Hardening the system - USB Device Control, Windows Defender
- Securing the Workstation : Applying the Castle Defense System (part 3) - Hardening the system - User Account Control
- Securing the Workstation : Applying the Castle Defense System (part 2) - Hardening the system - Local Security Policy and security configurations
- Securing the Workstation : Applying the Castle Defense System (part 1) - Protecting information, Working with protection
- Participating in Internet Newsgroups : Setting News Options - Options for Newsgroups and Messages, Options for Individual Newsgroups
- Participating in Internet Newsgroups : Filtering Newsgroup Messages, Rating Posts
- Participating in Internet Newsgroups : Notes on Working with Newsgroup Messages, Following Up a Message, Posting a New Message
- Participating in Internet Newsgroups : Downloading Messages
- Configuring Startup and Troubleshooting Startup Issues : Understanding the Startup Process (part 3) - Kernel Loading Phase
- Configuring Startup and Troubleshooting Startup Issues : Understanding the Startup Process (part 2) - Windows Boot Manager Phase
- Configuring Startup and Troubleshooting Startup Issues : Understanding the Startup Process (part 1) - Power-on Self Test Phase, Initial Startup Phase
 
 
Most view of day
- Microsoft PowerPoint 2010 : Animating Slide Content (part 2) - Special Options for Text Animation
- Windows Server 2012 Requirements and Installation : Installing Server 2012 (part 2) - Server with a GUI Install
- Windows Server 2003 on HP ProLiant Servers : Build Guides
- Microsoft Visio 2010 : Introducing Data Graphics (part 1) - What Is a Data Graphic?
- System Center Configuration Manager 2007 : Distributing Packages - Creating Collections (part 5) - Exclusion Collections
- Windows Phone 8 : Designing for the Phone - Blend Basics (part 4) - Working with Behaviors
- Microsoft Project 2010 : Linking Tasks (part 8) - Auditing Task Links,Using the Task Inspector
- Managing Windows 7 : Helping Each Other - Start the Session, Solve The Problem
- Using Voice and Sounds : Letting Your Computer Do the Talking, Creating a Sound File
- Collaborating Within an Exchange Environment Using Microsoft Office SharePoint Server 2007 : Understanding the History of SharePoint Technologies, Identifying the Need for MOSS 2007
Top 10
- Sharepoint 2013 : Working with the CSOM (part 6) - Working with the JavaScript client object model - Creating, reading, updating, and deleting in the JavaScript client object model
- Sharepoint 2013 : Working with the CSOM (part 5) - Working with the JavaScript client object model - Handling errors
- Sharepoint 2013 : Working with the CSOM (part 4) - Working with the JavaScript client object model - Returning collections
- Sharepoint 2013 : Working with the CSOM (part 3) - Working with the managed client object model - Creating, reading, updating, and deleting
- Sharepoint 2013 : Working with the CSOM (part 2) - Working with the managed client object model - Handling errors
- Sharepoint 2013 : Working with the CSOM (part 1) - Understanding client object model fundamentals
- Windows Phone 8 : Configuring Mailbox Settings (part 5) - Configuring Automatic Replies
- Windows Phone 8 : Configuring Mailbox Settings (part 4) - Lightening the Display,Changing the Mailbox Sync Settings
- Windows Phone 8 : Configuring Mailbox Settings (part 3) - Message Signatures, Blind CCing Yourself
- Windows Phone 8 : Configuring Mailbox Settings (part 2) - Unlinking Mailboxes, Conversation View
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro