Using the following code right out of the ActiveState docs works to read my
own computer event log, but when I run it against a remote computer
(replacing VIC20 with \\\\servername) it returns nothing, just executes and
ends with no output or error...

I am checking remote NT4 logs from a Win2K server... could that be the
problem?:

c

**
use Win32::EventLog;

 $handle=Win32::EventLog->new("System", "VIC20")
        or die "Can't open Application EventLog\n";
 $handle->GetNumber($recs)
        or die "Can't get number of EventLog records\n";
 $handle->GetOldest($base)
        or die "Can't get number of oldest EventLog record\n";
 while ($x < $recs) {
        $handle->Read(EVENTLOG_FORWARDS_READ|EVENTLOG_SEEK_READ,
                                  $base+$x,
                                  $hashRef)
                or die "Can't read EventLog entry #$x\n";
        if ($hashRef->{Source} eq "EventLog") {
                Win32::EventLog::GetMessageText($hashRef);
                print "Entry $x: $hashRef->{Message}\n";
        }
        $x++;
 }
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to