Loading...

MDT Monitoring: Deployment Success/Error Mail notification

1 A+ A-
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 ?


PreRequisites

- 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
series_Monitoring 3168406784384593898

Enregistrer un commentaire

1 commentaire

Drakrilla a dit…

Hello

I stumbled across your blog entry or script about "MDT Monitoring: Deployment Success/Error Mail notification".

The script is exactly what I was looking for.
But I want to run the script as part of a TaskSequence.

Your script is designed to monitor the deployment of a client.

I've played around with the script, but can't get it embedded in the deployment. I can do this, but it won't run, because the 100% deployment is only achieved after this task has been completed.)

I'm still quite a beginner at Powershell, and now hope you can give me some tips.

What do I have to adjust in the script, so that it runs as a standalone program as the last task of my deployment.

Which would also be great if I could embed an html link in the mail.

Can you help me?
That would be extremely nice.

Best regards
Stefan

Accueil item

Award

Sponsors

Learn KQL in one month

You want to support me ?

Mes articles en français

Books in French


Stats