Quantcast
Channel: THWACK: Popular Discussions - Kiwi Syslog
Viewing all articles
Browse latest Browse all 15803

running vbscript problems

$
0
0

I setup a rule that watches for certain event id's from our Domain Controllers. When these events comes across we have an action that logs that event to a file. All this works fine. The next thing is we have a 2nd action that is supposed to fire off a vbscript that parses the information out of the text file, and email that information to certain accounts.

The script runs fine if I run it manually either by double clicking or by running it from a cmd line. When I add the action for running the script and click "Test" I get a message in the eventlog.txt "Error occurred while running script file: C:\Scripts\email.vbs. Error info: Object required: 'WScript' on line: 1".

The following  is my script:

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set filetxt = objFSO.OpenTextFile("c:\temp\SyslogCatchAll.txt", ForReading, True)

strContents = filetxt.ReadAll

strSearchString1 = "Caller User Name:"
strSearchString2 = "Target Account Name:"


With iConf.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xchange2.mrhc.via-christi.org"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

With iMsg
Set .Configuration = iConf
.To = "<email accounts>"
.From = "<logger email account>"
.Subject = "Delete"
.textBody = "Time: " & Mid(strContents,1,19) & "Deleted by: " & Mid(strContents, InStr(strContents, strSearchString1) + 18,12) & "Deleted Account: " & Mid(strContents, InStr(strContents, strSearchString2) + 21,15)
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing

filetxt.Close

objFSO.DeleteFile("c:\temp\SyslogCatchAll.txt")

 

Is there something wrong with my script that doesn't allow Kiwi to run it?


Viewing all articles
Browse latest Browse all 15803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>