Re: Create an event log entry

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




If you're using Windows Server 2003 or Windows XP, the easiest way is to launch
EventCreate.exe. If that won't work for you, then tell us which scripting
language your scripts are written in :)


C:\>EventCreate.exe /?

EVENTCREATE [/S system [/U username [/P [password]]]] /ID eventid
[/L logname] [/SO srcname] /T type /D description

Description:
This command line tool enables an administrator to create
a custom event ID and message in a specified event log.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under which
the command should execute.

/P [password] Specifies the password for the given
user context. Prompts for input if omitted.

/L logname Specifies the event log to create
an event in.

/T type Specifies the type of event to create.
Valid types: ERROR, WARNING, INFORMATION.

/SO source 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.

/ID id Specifies the event ID for the event. A
valid custom message ID is in the range
of 1 - 1000.

/D description Specifies the description to be set for
the newly creating event.

/? Displays this help/usage.


Examples:
EVENTCREATE /T ERROR /ID 100
/L APPLICATION /D "Create an event in application log"

EVENTCREATE /T ERROR /ID 999 /L APPLICATION
/SO WinWord /D "new source Winword in application log"

EVENTCREATE /S system /T ERROR /ID 100
/L APPLICATION /D "Remote system without user credentials"

EVENTCREATE /S system /U user /P password /ID 100 /T ERROR
/L APPLICATION /D "Remote machine with user credentials"

EVENTCREATE /S system /U domain\user /ID 100 /T WARNING
/SO MyBatchFile.cmd /D "Maintenance script user logon failed"



"Paul Jensen" <Paul Jensen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ADA1E990-9AF4-42A4-9414-E3FDB06C85C3@xxxxxxxxxxxxxxxx
I want to log the time and duration of my scripted VM backups.

Any ideas?

Thanks.




.



Relevant Pages

  • Re: Printer Admin Object
    ... and ports on local and remote computers. ... Add and delete a local or remote printer. ... Instrumentation scripts in Windows Server 2003, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: auto shutdown
    ... script will do a reboot of the remote computer. ... If you want a forced shutdown, ... You can find peer-to-peer support for Scripting technologies in the Windows Server Scripting newsgroup. ...
    (microsoft.public.windowsxp.basics)
  • Re: Positioning content with div tags - whats wrong here?
    ... I don't consider pages on your personal site to be standards ... | With the publication of, Scripting Media Types, by the ... | This attribute specifies the scripting language of the element's ... | At one time the RFC Editor and the IANA were one person, Jon Postel, ...
    (comp.lang.javascript)
  • Re: Disabling old account script needed
    ... When the domain functional level has been set to Windows Server 2003, a new lastLogonTimestamp attribute is used to track the last logon time of a user or computer account. ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windows.server.active_directory)
  • Re: ~~Auto logoff when Inactivates for 5 mins
    ... Windows Server 2003 Resource Kit Tools ... off or shuts the computer down after a set amount of idle time (the ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.win2000.general)