Read all event logs, search for string, if found - encrypt and send E-mail
Top  Previous  Next


// Read all events from the event log on \\EDU12
// Search all columns from 4 to end for the substring "fail"
// If matches found:
//  Write matching lines to a file
//  Encrypt the file
//  Send an E-mail to the administrator

[Settings_Begin]
FileType=NTreport
NTinfo.Name.All.Rows=Yes
NTinfo.Event.Log=Yes
NTinfo.Event.Log.Log=*ALL*
NTreport.Delimiter=,
[Settings_End]

[Batch_Begin]
Clear.Window Main
Get.Data \\EDU12
Clear.Window Filter
Filter %COL1-% = *fail*
If Filter
DOS del c:\temp\fail.log
Write.File c:\temp\fail.log ; Filter ; %col1-%
DOS del c:\temp\fail.asc
DOS "set pgppath=c:\ntreport && c:\ntreport\pgp.exe -e -r test@wennstrom.org -at c:\temp\fail.log"
DOS c:\ntreport\\blat.exe  c:\temp\fail.asc  -t test@wennstrom.org  -s "Fail  \\EDU12 %date%"
Endif
[Batch_End]