in reply to Writing to Event Log (Security)

What happens when you run your code, an error/warning message?

#!/usr/bin/perl use strict; use warnings; use Win32::EventLog; my $handle = Win32::EventLog->new("Application") or die "Can't open Ap +plication EventLog\n"; my $Event = { EventType => EVENTLOG_AUDIT_FAILURE, Category => 'Login', EventID => 5, Data => "Some dummy data", Strings => "This is event is generated by a Test Script", }; $handle->Report($Event);

The above code works for me.

Martin

Replies are listed 'Best First'.
Re^2: Writing to Event Log (Security)
by bbaski (Initiate) on Mar 17, 2009 at 13:10 UTC
    I am using new("Security") instead of new("Application")
    Eg:
    my $handle = Win32::EventLog->new("Security") or die "Can't open Application EventLog\n";
    The script run without error
    But i dont see any entry under Security


    Waiting for hopefully...