D
David Johnson
Hi, I'm using wmi to read the event log. After just a small number of
entries, it really slows down. I'd really like to speed it up.
Any suggestions?
Here's a code snippet:
'Connect to WMI using the current user's credentials
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate,(Security)}!\\" &
strComputer & "\root\cimv2")
'
'Query WMI for all 539 errors in the event log
'Note: This takes a long time on big event logs
wscript.echo "Retrieving records from the Security Log."
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Security' and EventCode =
'539'")
'
'For all the Event records with 539 errors...
For Each objEvent in colLoggedEvents
'
'do stuff
Next
entries, it really slows down. I'd really like to speed it up.
Any suggestions?
Here's a code snippet:
'Connect to WMI using the current user's credentials
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate,(Security)}!\\" &
strComputer & "\root\cimv2")
'
'Query WMI for all 539 errors in the event log
'Note: This takes a long time on big event logs
wscript.echo "Retrieving records from the Security Log."
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Security' and EventCode =
'539'")
'
'For all the Event records with 539 errors...
For Each objEvent in colLoggedEvents
'
'do stuff
Next