By David Wiseman (Administrator)Created 08 Feb 2008
My Rating:
Vote
Rating:
Not Rated
Views:3727
Downloads:51

List Event Log Properties

Language:  VBScript

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 Yes Windows NT Yes
Vista Unknown Windows 2008 Unknown
Description

Retrieves a list of properties for all the event logs on a computer, except the Security event log.

Code

Line Numbers: On  Off      Plain Text
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objInstalledLogFiles = objWMIService.ExecQuery _
    ("Select * from Win32_NTEventLogFile")

For each objLogfile in objInstalledLogFiles
    Wscript.Echo "Name: " &  objLogfile.LogFileName 
    Wscript.Echo "Maximum Size: " &  objLogfile.MaxFileSize 
    If objLogfile.OverWriteOutdated > 365 Then
        Wscript.Echo "Overwrite Outdated Records: Never." 
    ElseIf objLogfile.OverWriteOutdated = 0 Then
        Wscript.Echo "Overwrite Outdated Records: As needed." 
    Else
        Wscript.Echo "Overwrite Outdated Records After: " &  _
            objLogfile.OverWriteOutdated & " days" & 
    End If
Next

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
Be the first to post a comment!