Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Vista

Automating Vista Events

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server