use Win32::EventLog; use Win32::AuthenticateUser; #LOGIN Infos in ADM print "######LOGIN-INFOS######\n"; print 'Domain: '; chomp(my $domain = ); print 'User: '; chomp(my $user = ); my $password=&getpassword(); AuthenticateUser("$domain", "$user", "$password"); $myServer="\\\\XYCAA01"; # your servername here. my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4])); my($dest); for my $eventLog ("Application", "System", "Security") { $handle=Win32::EventLog->new($eventLog, $myServer) or die "Can't open Application EventLog on $myServer\n"; $dest="C:\\WINDOWS\\Temp\\BackupEventLogs\\$eventLog\\$date.evt"; $handle->Backup($dest) or warn "Could not backup and clear the $eventLog EventLog on $myServer ($^E)\n"; $handle->Close; }