Create event from command line in Windows

Using eventcreate command you can create a custom event and log it in any of the event log files(System, Application).

Usage:

eventcreate  /id event_id  /d event_description /t event_type /l event_log_file

/s Computer : Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.

/u Domain User : Runs the command with the account permissions of the user specified by User or DomainUser. The default is the permissions of the current logged on user on the computer issuing the command.

/p Password : Specifies the password of the user account that is specified in the /u parameter.

/l { APPLICATION | SYSTEM } : Specifies the name of the event log where the event will be created. The valid log names are APPLICATION and SYSTEM.

/so SrcName : Specifies the source to use for the event. A valid source can be any string and should represent the application or component that is generating the event.

/t { ERROR | WARNING | INFORMATION | SUCCESSAUDIT | FAILUREAUDIT } : Specifies the type of event to create. The valid types are ERROR, WARNING, INFORMATION, SUCCESSAUDIT, and FAILUREAUDIT.

/id EventID : Specifies the event ID for the event. A valid ID is any number from 1 to 65535.

/d Description : Specifies the description to use for the newly created event.

Examples

eventcreate /id 5000 /d "windows installation failed.” /t ERROR /l system
eventcreate /id 1000 /d "Create event in application log.” /t INFORMATION /l application
%d bloggers like this: