Have ConfigMgr send an email after deployment (including log parsing)

Over the years I have been using a few different scripts to have the task sequence send an email when the deployment is completed. For example this post: Configure MDT 2010 to send an email when deployment is completed. Another common way to do this is to use status filter rules in ConfigMgr. A good example is the Send an email when OSD completes a deployment post by Benoit Lecours.

Anyway, this week I've been implementing a ConfigMgr v1511 platform for a customer, and they wanted a small script that not only sent an email when deployment was done, but also parsed the log files for warnings and errors, and include them in the email. And since MDT Lite Touch already have much of that code built-in, it didn't take to long to customize it for ConfigMgr. The customer (thanks Erik and Joakim) also said yes to my request on posting this script for the community (after cleaning up some unique info):

Flaschenpost im Sonnenuntergang
Maybe not an email, but still 🙂

The Email

Here is a sample email from the script:

MAIL

The Script

Simply add the script to your MDT package in ConfigMgr, modify the email address and server in it. Then add a Run Command Line action in the task sequence to call it.

Note: The script is a WSF script, so it needs the .wsf extension.

The script:
https://github.com/DeploymentResearch/DRFiles/blob/master/Scripts/ZTI-SendEmail.wsf

About the author

Johan Arwidmark

0 0 votes
Article Rating
Subscribe
Notify of
guest
6 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Ed KK
Ed KK
2 years ago

Johan, I'd like to have this send a notice to a user at the end of an application installation task sequence. So, a user initiates a TS from Software Center, and it then installs several apps and reboots the machine. Before it reboots, I'd like it to send an email to that user letting them know that the system has finished and rebooted. Do you know how I can have the TS look up the users email? I presume we would have to do an LDAP query against AD to pull the email, but not really sure how to query… Read more »

Joe T
Joe T
3 years ago

Johan i am trying to implement this script as it is pretty cool. i am getting an error on line 46, 31 windows script host: unrecognized markup. suggestions on how to fix that?

Dennis Roteliuk
Dennis Roteliuk
3 years ago

Hi Johan, is this script available for download?


>