This is my third post about MDT Monitoring, I will now 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 script ?
- 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 your deployment.
Once the deployment completed successfully, you will receive a mail as below :
If the deployment failed, you will receive one of the below mail. As explained in my previous post, if the deployment doesn’t 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 information below :
- Your SMTP server
- Sender mail adress
- Recipient mail address
See below an exemple of this xml file :
Source : D. Van Robaeys, www.systanddeploy.com