How do I connect to a remote NT box to check the system event log...I'm using
the following code but keep getting the error: Can't get number of EventLog records
Roth's webpage says you have to change "System" to UNC??? (I'm connecting to the remote
machine as a domain admin).
<CODE_SNIPPET>
use Win32::EventLog;
$handle=Win32::EventLog->new("System", "\\\\MYPDC")
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}<br>\n";
}
$x++;
}
</CODE_SNIPPET>
Thanks in advance for any help.
Ewen
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs