Read EventLog Setting

vbscriptRead the eventlog settings by using the following script. 

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")
Set objInstalledLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile")
WScript.Echo "Name|MaxSize|Overwrite"
For each objLogfile in objInstalledLogFiles
If objLogfile.OverWriteOutdated > 365 Then
strOverwriteOutdated = "Never"
ElseIf objLogfile.OverWriteOutdated = 0 Then
strOverwriteOutdated = "As needed"
Else
strOverwriteOutdated = objLogfile.OverWriteOutdated & " days"
End If
Wscript.Echo objLogfile.LogFileName & "|" & objLogfile.MaxFileSize & "|" & strOverwriteOutdated
Next

022213_2242_Justatest1

About the Author

wvsandwijk

I am a Technical Specialist - Cloud Infrastructures from the Netherlands. My Skills are mainly PowerShell, VMWare, Hyper-V, Microsoft System Center products and Windows Azure Pack. I work for a company in Utrecht The Netherlands.

No Comments

Comments are closed.