in reply to WMI EventLog

A few ideas:

print "$aevent{TimeGenerated}\n";

should probably be

print $aevent->{TimeGenerated} . "\n";

Next, try replacing $Wmi->ExecQuery("...")

with the InstancesOf method

$aevents = $Wmi->InstancesOf($Win32_Class)

While this should return all events (not what is wanted), it might reveal the query statement is the problem. I mean, let's try to get something back, and then we can narrow it down. ;)

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re: Re: WMI EventLog
by Mitch (Sexton) on Feb 11, 2003 at 20:43 UTC
    You got it, thanks. There were two problems...1) The property should be LogFile not LogFileName. The source I used had it listed wrong. 2) LogFile is a string so it needs to be in ' '. The line should read:
    if ($aevents = $Wmi->ExecQuery("SELECT * FROM $Win32_Class WHERE LogF +ile='Application' AND Eventcode=1000")) {


    Thanks for the insight.

    Mitch