Solved

VBS Backup Message Notification

Posted on 2009-07-01
3
347 Views
Last Modified: 2013-12-20
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
Comment
Question by:TechsupportAbility
  • 2
3 Comments
 
LVL 3

Expert Comment

by:astroviper
Comment Utility
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
 
LVL 3

Accepted Solution

by:
astroviper earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:TechsupportAbility
Comment Utility
This worked perfectly. Thank you very much for you help!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now