Deployment Solution

 View Only
  • 1.  Notification on job completion

    Posted Jul 02, 2010 05:51 PM
    Is there a way (or a good script) to have DS send me an email notification when a job has completed?  I'm using 6.9 SP4 and I'd like to be able to fire off jobs and know the moment they're finished without having to watch my console or the machine that's being imaged.


  • 2.  RE: Notification on job completion
    Best Answer

    Trusted Advisor
    Posted Jul 03, 2010 04:22 AM
    Hi David,

    There is a example of this in the samples folder, "Samples -> Scripts -> Windows -> Send error email"

    What you is tailor this script, and make one for success and failure. Then using conditions on your tasks, you can link success and failure return codes to this script. The script can be generic, so you can link to the same success email script for all your tasks you want a success email alert for.

    Just in case you've deleted your samples folder, here's the Altiris provided script:


    'Send mail showing that there was an error. 'vbscript ' Description: This will send an email message to the specified ' recipient using the SMTP server and account to ' indicate an error with the Job that was executed. '--------------------------------------------------------------------------------------------------- Dim Conf Dim Message Dim SMTPServer Dim FromName Dim ToName Dim SendUsername Dim SendPassword Const SendUsingPort = 2 ' Set the variables used to send the message SMTPServer = "SMTPSERVER" FromName = "user@domain.com" ToName = "user@domain.com" ' Setup the configuration for the message to use Set Conf = CreateObject("CDO.Configuration") With Conf.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = SendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer .Update End With 'Setup the message Set Message = CreateObject("CDO.Message") With Message Set .Configuration = Conf Dim JobName JobName = """%CALLINGJOBNAME%""" 'Set email adress, subject And body .To = ToName .Subject = "%COMPNAME% " & JobName & " job Failed" .TextBody = "DS Job " & JobName &" for " & "%COMPNAME%" & " Failed at " & Date & " " & Time .From = FromName .Send End With