Okay, here's the situation background:
At the bank I work for, we have a total of 5 Dell servers. All of the servers have Dell OpenManage installed. OpenManage will trigger an executable when the server run into an error. I have a series of batch files to call several VBSripts. These VBScripts send an email to certain people.
Now, here's the problem:
The system is fully functional, but I'm shooting for efficiency. In order to add an email address to the list of notified people, I have to go in and edit a bazillion different VBScripts for each server . . . and that's not fun. I would like to be able to have all of the VBScripts reference an external text file with a list of contact email addresses. I thought that this would be pretty simple . . . but I think that I might have been overly confident in my newly found skills! Here is an example of my Chassis Intrusion Script:
There are no errors . . . it just sits there and does absolutely nothing! If I remove the strName, and enter an email address in the format: "Display Name <email@server.com>" everything works perfectly. Arg! This is all very frustrating! Any help would be greatly appreciated!
[∞]MP
At the bank I work for, we have a total of 5 Dell servers. All of the servers have Dell OpenManage installed. OpenManage will trigger an executable when the server run into an error. I have a series of batch files to call several VBSripts. These VBScripts send an email to certain people.
Now, here's the problem:
The system is fully functional, but I'm shooting for efficiency. In order to add an email address to the list of notified people, I have to go in and edit a bazillion different VBScripts for each server . . . and that's not fun. I would like to be able to have all of the VBScripts reference an external text file with a list of contact email addresses. I thought that this would be pretty simple . . . but I think that I might have been overly confident in my newly found skills! Here is an example of my Chassis Intrusion Script:
Code:
'=====================================================
'Script Beginning
'=====================================================
Const ForReading = 1
Const Source = "\\server2006\tech\servalert\phonelist.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objList = objFSO.OpenTextFile(Source, ForReading)
Set objMessage = CreateObject("CDO.Message")
strName = objList.Readline
Do Until objList.AtEndofStream
objList.Close
With objMessage
.To = strName
.From = "ServAlert <webmaster@cbobanker.com>"
.Subject = "Server2006"
.TextBody = "Server2006 has reported a chassis intrusion. Please take immediate action."
'-----------------------Remote Server Configuration
objMessage.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
'Remote SMTP Server IP
objMessage.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "mail.cbobanker.com"
'Server port
objMessage.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
objMessage.Configuration.Fields.Update
'--------------------End of configuration
objMessage.Send
End with
Loop
'=====================================================
'End of Script
'=====================================================
There are no errors . . . it just sits there and does absolutely nothing! If I remove the strName, and enter an email address in the format: "Display Name <email@server.com>" everything works perfectly. Arg! This is all very frustrating! Any help would be greatly appreciated!
[∞]MP