Sunday, January 18, 2009

wipe out entries not wanted in Event Log

to clear an event log's entries of the Application log

PS> $AppLog = new-object -typename system.diagnostics.eventlog -argumentlist application
PS> $AppLog

Max(K) Retain OverflowAction Entries Name
------ ------ -------------- ------- ----
51,200 -1 DoNotOverwrite 2,523 Application <--- before


PS> $AppLog.Clear()
PS> $AppLog

Max(K) Retain OverflowAction Entries Name
------ ------ -------------- ------- ----
51,200 -1 DoNotOverwrite 0 Application <--- after

No comments:

Post a Comment