Showing posts with label eventlog. Show all posts
Showing posts with label eventlog. Show all posts

Monday, January 19, 2009

get information about .NET Framework DLL

PS> [system.diagnostics.eventlog] | fl

Module : System.dll
Assembly : System, Version=2.0.0.0
BaseType : System.ComponentModel.Component
Namespace : System.Diagnostics
Name : EventLog
MemberType : TypeInfo

change MaxSize of EventLog via registry

to overwrite a pre-existing registry entry value

PS> New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Eventlog\Application -Name MaxSize -PropertyType DWord -Value 512 -force

'512' is in decimal format; it means 512KB

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

gather total number of Event Log entries

to get information about an event log, e.g. Application

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

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

Event viewer won't show these valuable information.