MDT: Deployment Success/Error Mail notification

Stefan Wehrli 1 Reputation point

MDT: Deployment Success/Error Mail notification

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

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

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
835 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,403 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenLiu-MSFT 41,136 Reputation points Microsoft Vendor

    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:

    You may also try this guidance:
    (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.