I'm trying to help out a customer. The simple script below runs very quickly
on a local system however on a remote production server it takes upwards of
40 minutes! Any ideas?
Set colLogFiles = objWMIService.ExecQuery( "SELECT LogfileName FROM
Win32_NTEventlogFile" )
For Each objLogFile in colLogFiles
'Find all the event log entries in that log.
Set colEvents = objWMIService.ExecQuery( "SELECT * FROM Win32_NTLogEvent
WHERE Logfile = '" & objLogFile.LogFileName & _
"' AND TimeGenerated > '" & strThen & "'" )
count = 0
For Each objEvent in colEvents
' Display some information about the event log entry and stop processing
the rest of them.
Wscript.Echo " " & objLogFile.LogFileName & ": Event ID: " &
objEvent.EventCode & "; Time: " & objEvent.TimeGenerated
count = count + 1
If count >= 10 Then
Exit For
End If
Next
Next