I am trying to Query the security event log using WMI and there does not
seem to be any information in the win32_NTLogEvent for Security, does anyone
know where that is in WMI or is there something I need to turn on for this
to log the info in WMI. I have already enabled logging and I can view the
events when I open up the event log, but nothing shows up when I look at the
instances in WMI?

any help would be appreciated...

Thanks
Gavin...

Re: Query Security Log Files in WMI by philliprogers

philliprogers
Thu Apr 13 02:37:49 CDT 2006

Try this Microsoft script which retrieves properties for the Security
event log :

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Security)}!\\" & _
strComputer & "\root\cimv2")

Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile where LogFileName='Security'")

For Each objLogFile in colLogFiles
Wscript.Echo objLogFile.NumberOfRecords
Wscript.Echo "Maximum Size: " & objLogfile.MaxFileSize
Next

Hope that this helps.