I was querying the Security log from a server with eventquery.vbs, suddenly the Microsoft script returned this error:
ERROR: Unable to execute the query for the 'security' log.
Turned out that this error appears when the Security log is over 10MB, equal to 32767 records. Got it solved by changing CInt by CLng, at Line 1700 – 170
Old code: If CInt(objLogs.Item(arrKeyName(intLoopCount))) > 0 Then strFilterLog = arrKeyName(intLoopCount) intRecordRangeFrom = 0 intRecordRangeTo = CLng(objLogs.Item(arrKeyName(intLoopCount))) New code: If CLng(objLogs.Item(arrKeyName(intLoopCount))) > 0 Then strFilterLog = arrKeyName(intLoopCount) intRecordRangeFrom = 0 intRecordRangeTo = CLng(objLogs.Item(arrKeyName(intLoopCount)))
You posted the same code twice silly pants.
The same OLD code, no less.
Old code: If CInt
New code: If CLng
Added red color to highlight what was changed.
Thanks for the code, much appreciated.