Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBS Backup Message Notification

Posted on 2009-07-01
3
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:astroviper
ID: 24760194
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 2000 total points
ID: 24760204
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
ID: 31598808
This worked perfectly. Thank you very much for you help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 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