Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

VBS Backup Message Notification

I have a Backup script written in VBS that we want to give to one of our employees in Payroll to run whenever he needs it done. In order to monitor it on our end we want it to send a message to our Network Admin either through a command prompt or an email whenever it is run.

I myself am not very familiar with VB, the code we are using is open source and I just changed a few things to fit with our needs.

If anyone has any ideas as to what I should try out I'd greatly appreciate it.
0
TechsupportAbility
Asked:
TechsupportAbility
  • 2
1 Solution
 
astroviperCommented:
Could send an email if you have a mail server on your network that supports it.

Set objMessage = CreateObject("CDO.Message")
objMessage.MimeFormatted = True
objMessage.From = "Mr. Someone <anyuser@wherever.com>" 
objMessage.To = "destination@there.com
objMessage.Subject = "subject here"
objMessage.HTMLBody = "body html here"
 
 
'==This section provides the configuration information for the remote
'== SMTP server. Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mailserver ip"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
 
objMessage.Send

Open in new window

0
 
astroviperCommented:
I missed a double quote on the end of line 4. Could also use net send if your on xp.

Name = "net send {name | * | /DOMAIN[:name] | /USERS} message"
Set objShell = CreateObject("WScript.Shell")
Return = objShell.Run(Name, 1, true)

Open in new window

0
 
TechsupportAbilityAuthor Commented:
This worked perfectly. Thank you very much for you help!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now