How to create events on Windows' logs?
Date: January 8th, 2008
Author: Derek Schauland
Category: Windows Server 2003, disaster recovery, tip
Tags: Event, Microsoft Windows Server, Microsoft Windows, Argument, Microsoft Windows Server 2003, Derek Schauland
Windows Server 2003 logs many types of events for all sorts of events, including applications, system events, and security items. These event logs are helpful in tracking down performance issues and problems with the operating system or applications running on the server. You may find log entries especially useful for recording other events to the log by using the Windows Server 2003’s command line utility. You can issue this utility within a batch file to record the actions of the batch file or call upon it during an installation to an event log.
The Event Create command for creating an event log entry is EventCreate. Executing the EventCreate command with the /? argument provides the commands shown in the table below.
C:> eventcreate /S \\servername /L Application /T Success /SO Application Name /ID 1754 /D “Description of event”
You can record any event to the logs with this command. Windows Server 2003 adds many events to the logs without user intervention, but any custom scripts you create to assist you in performing any tasks may not remain recorded on your system unless you record them.
When performing automated tasks on remote systems, recording the automated tasks to the event logs can help you or other administrators understand what actions you performed and how the system responded.
Note: The EventCreate command also works on Windows XP and Vista systems.
Source