MDT: Deployment Success/Error Mail notification

Stefan Wehrli 1 Reputation point
2022-03-18T09:42:08.277+00:00

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 for business Windows Client for IT Pros Devices and deployment Set up, install, or upgrade
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenLiu-MSFT 49,311 Reputation points Microsoft External Staff
    2022-03-21T06:39:39.593+00:00

    Hi, @Stefan Wehrli

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.