question

StefanWehrli-7192 avatar image
0 Votes"
StefanWehrli-7192 asked StefanWehrli-7192 edited

MDT: Deployment Success/Error Mail notification

MDT: Deployment Success/Error Mail notification

Hello Community, I would like to extend our MDT mail notification and came across this link:

https://www.systanddeploy.com/2017/03/mdt-monitoring-deployment-successerror.html

I would like to call the whole thing as a tasksequence at the end of the deployment, and not have to enter the computer name manually, but that the $env:COMPUTERNAME is taken from MDT.

Can someone help me to adapt the script so that the XML file with the parameters is already part of the PS script, and that as mentioned above the $env:COMPUTERNAME is taken instead of the manual entry.

I thank you already for your support.

Best thanks
Stefan


windows-server-powershellmem-cm-site-deploymentmem-mdt
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered StefanWehrli-7192 edited

Hi, @StefanWehrli-7192

Thank you for posting in Microsoft Q&A forum.

It seems it's difficult to get the computer name and add the computer to the script because the script is running on the other computer.
We may consider to run a script on the computer we are deploying, such as: add a ZTISendmail application as the final step of the task sequence like this article:
https://www.deploymentresearch.com/configure-mdt-2010-to-send-an-email-when-deployment-is-completed/

You may also try this guidance:
https://community.spiceworks.com/how_to/138021-e-mail-notifications-for-mdt
(Please Note: Since the website is not hosted by Microsoft, just for your reference.)



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @AllenLiu-MSFT

I am currently using a customized script based on https://www.deploymentresearch.com/configure-mdt-2010-to-send-an-email-when-deployment-is-completed/.

I want to run the script as described above on the MDT server and send the mail as last step in task sequence.

The PC name is available in the variable %OSDComputername% as in the script you posted.

I just wanted to modify the script I posted in my question to run on the MDT server and instead of asking for the manual PC name input, use the value from %OSDComputername%, that's all.

I find it status mail from https://www.systanddeploy.com/2017/03/mdt-monitoring-deployment-successerror.html just more appealing regarding the colors by status etc.

0 Votes 0 ·