Deployment Solution

 View Only

Send Email Notification to Tech After Completed Job 

Jul 15, 2009 05:34 PM

This little vbscript for sending an smtp message is useful to put as the last task of a Altiris Deployment Server job so that it emails the tech after the job has completed successfully.

The following DS variables are used:
%JOBUSER% -- the person who ran the job in Deployment Console
%NAME% -- the name of the computer in Deployment Console
%JOBNAME% -- the name of the job that was run in Deployment Console

In my version of this script, I have the "domain.com" portion in the From & To sections set to the domain of my organization. The Textbody section can have as much info as you want.

' Notify Tech when complete
'vbscript

' ===== Send Notification E-Mail =====
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "%JOBUSER%@domain.com"
objEmail.To = "%JOBUSER%@domain.com"
objEmail.Subject = "%JOBNAME% | %NAME%"
objEmail.Textbody = "Altiris Deployment Solution job: %JOBNAME% was run on computer: %NAME% by %JOBUSER%."
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"exchange1.umcaz.edu"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
' ===== Destroy Objects when Finished =====
Set objEnv = Nothing Set WshShell = Nothing

Edit: Someone found out this only works if you have security turned on in the console.

Statistics
0 Favorited
1 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Oct 09, 2013 01:33 PM

I've attempted to reproduce an alternative for DS 7.1/ITMS and above here: https://www-secure.symantec.com/connect/articles/emailing-user-job-completion-smp-71 in an article where I create the token required. It is pending release at the time but i'll forget if i wait any longer.

There reason i'm posting on a very old thread is because searching still provides this result but to the wrong product if you wanted the solution for ITMS/CMS etc.

Sep 29, 2009 10:24 PM

 Was anyone able to use %DSServer% in the from line? My email arrived with %DSServer% still as the "From". 

Jul 16, 2009 01:01 PM

Ah, interesting point. We don't do any 'job spawning' (LOL), but it makes sense.

Jul 16, 2009 12:59 PM

A warning on this, if you use a Job to spawn another Job containing this file the %JOBUSER% variable may not be set even if you are currently using Security.

Jul 16, 2009 12:52 PM

I am glad it's useful to you. We've had it so long that I can't remember whether I found it on an Altiris site/forum, or if I ran across the vbscript on the intertubes and thought it would be a good fit for DS... either way it helps a lot. We use it either just to let the tech know that their job is done (such as an image job), or if it's an application install that requires post-install tweaking, they get a reminder to do that.

Jul 16, 2009 07:42 AM

The script doesn't work for me because the %JOBUSER% variable is empty. The other varibles contains values, but %JOBUSER% returns nothing. What am I doing wrong?

EDIT: Nevermind. I had to enable security in the Deployment Console.

Jul 15, 2009 10:08 PM

I gotta say, this is one of the best ideas I have seen for DS in a long time.  Excellent idea so that when we que up jobs, work on something else, and know when to come back and check out and continue our work when we upload an image, deploy a package, run a script, etc.  A++++

Related Entries and Links

No Related Resource entered.