Search Events

Search event properties to find an occurrence of the search string.



Input Parameters

Name Type Required Description
Log Name String Yes The name of the event log to search.
Start Date DateTime Yes The start date to begin the search.
End Date DateTime Yes The event date to stop searching the log.
# of Events Number Yes The number of events to return. The default value is 100.
Event ID Number No The event ID of an event to search the log.
Event Type/Level Selection Yes The type of the event to search: All, Error, Information, FailureAudit, SuccessAudit, Warning.
Source String Yes The name of the source of the event to search.

Output Parameters

Name Type Description



Returns a success value of zero or any value other than zero to indicate failure.



Returns the results as a collection of events containing the following:

  • Source
  • EntryType
  • UserName
  • EventID
  • MachineName

Example Input Parameters

Name Type Required Example
Log Name String Yes Application
Start Date Date Yes 02/18/2013
End Date Date Yes 02/18/2013
# of Events Number Yes 10
Event ID Number No <intentionally left blank>
Event Type/Level Selector Yes All
Source String No <intentionally left blank>