Hi all,

I am doing a WMI query to the event log for a specific event. However, how
can I quickly and easily test whether the query returns anything? Currently
I use a count statement on the result, but this takes ages (minutes) to
return a result. How can I speed this process up or do it another way. Here
is my code:

Set wmi = GetObject("winmgmts:\\" & Server.get("rdn") & "\root\CIMV2")

wql = "select * from Win32_NTLogEvent where logfile='Application' and
eventcode='1221' and sourcename='MSExchangeIS Private'"

Set result = wmi.ExecQuery(wql)

if result.count = 0 then
   do something
End if

TIA,

Paul



----------------------------------------------------------------------
If you have received this e-mail in error or wish to read our e-mail 
disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender.
----------------------------------------------------------------------


------
You are subscribed as [EMAIL PROTECTED]
Web Interface: 
http://intm-dl.sparklist.com/cgi-bin/lyris.pl?enter=nt2000&text_mode=&lang=english
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to