I would like to have an e-mail sent everyday of all failed logon attempts. First, I have defined the proper group policy in Active Directory, but I don't know which server will have all this information stored.
Secondly, I would like to have a VBScript send an e-mail of all failed attempts everyday. Below, I have a partial script created (to send to a document), but I don't know how to send it through e-mail. Please help. I would like to schedule a task everyday to run this script, but it has to be on the server where the logon attempts are being stored.
Dim objFSO, objTS, strComp, objWMIService, WBEMlocator, SWBEMlocator, UserName, Password, colItems
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTS = ObjFSO.OpenTextFile("S:\Logs\LoginFailure.txt")
Do until objTS.AtEndOfStream
strComp = "."
UserName = ""
Password = ""
Set WBemlocator = CreateObject("WBemScripting.SWBemLocator")
Set objWMIService = SWBemLocator.ConnectSever(strComp, _
Set colItems = _
objWMIService.ExecQuery("Select * from Win32_NTLogEvent")
For Each objItem in colItems
If objItem.EventIdentifier = 538 Then
WScript.Echo "TimeGenerated: " & objItem.TimeGenerated
Wscript.Echo "TimeWritten: " & objItem.TimeWritten
Wscript.Echo "User: " & objItem.User
Wscript.Write "Found Event ID"