MDT Monitoring: Deployment Success/Error Mail notification

This is my third post about MDT Monitoring. I will show you a way to monitor your deployment from a client computer and send an email in case of deployment success or error.

How to get the scripts ?


- MDT Monitoring enabled on the server 
- MDT Monitor services started on the server
Can be used on any Windows 7 or Windows 10 computer.
No need to run it on the MDT server, you can run it on a client computer.

How to use it ?

1 / Run the Monitoring.ps1 file
2 / You will be asking for the computer name to monitor
3 / Once you have typed the computer name, let the script work.
Don't close the PowerShell window, the script will analyze yout deployment.

Deployment notification

Deployment success

Once the deployment completed successfully, you will receive a mail as below

Deployment error

If the deployment failed, you will receive one of the below mail.
As explained in my previous post, if the deployment dooesn'tt answer for the four past hours, deployment status will be set to 4 meaning Unresponsive. 
In this case you will receive a mail as below

If another error occurs, meaning deploymentstatus is set to 2, you will receive a mail as below

How it works ?

First, you will need to complete the Monitoring_infos.xml file.
Type your Deployment Share path and MDT module paths. The MDT module should be the path to the MicrosoftDeploymentToolkit.psd1 file. By default this file is located in C:\Program Files\Microsoft Deployment Toolkit\Bin.
In order to send and receive the mail you will need to type the informations below
- Your SMTP server
- Sender mail address
- Recipient mail address

See below an exemple of this xml file.

See below the main PS1 script, Monitoring.ps1 that will analyze your deployment.

petit test toto tata

Share this

Related Posts

Next Post »