Thought I would just post this here in case anyone was trying to do something similar. I wanted to get a notification when a build was complete so it wasn't sitting around waiting while we were busy.
I used to do this with a vbs script but with the inclusion of powershell now, it is done quite simply.
function sendMail{ $smtpServer = "mailserver.com.au" $msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.IsBodyHTML = $true $msg.From = "MDT.Deployment@mailserver.com.au" $msg.To.Add("recipient@mailserver.com.au") $msg.subject = "Build complete : " + $env:computername $msg.body = "$body" $smtp.Send($msg) } $bios = get-wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" $computer = get-wmiobject win32_computersystem -namespace "root\CIMV2" $scriptpath = split-path ($MyInvocation.MyCommand.Path) $Header = [IO.File]::ReadAllText($scriptpath + "\Notification\Header.html") $Footer = [IO.File]::ReadAllText($scriptpath + "\Notification\Footer.html") $body = $Header $body = $body + '<div style="line-height: 150%;">' $Body = $body + '<br>' + "Computer Name : " + $tsenv:OSDComputername $Body = $body + '<br>' + "Username : " + $tsenv:Administrators003 $Body = $body + '<br>' + "Model : " + $computer.model $Body = $body + '<br>' + "Manufacturer : " + $computer.manufacturer $Body = $body + '<br>' + "BIOS Serial : " + $bios.SerialNumber $body = $body + '</div>' $body = $body + $footer sendmail
Save the above as Notify.ps1 in the Scripts folder of your deployment share, then add a TS step to run a powershell script and addNotify.ps1 as the command.
Might give you enough of an idea to implement yourself.
As a note, I have two files Header.html and Footer.htmlin a sub-folder of %scriptroot%\Notification which contains a nice header and styling, and then our corporate footer - to match our helpdesk notification style. You can remove this if needed and just pass a simple html email through the PS script.
We use Administrator003 to add the user to local admins (dont ask) so that equals the user the build is for.
Obviously adjust the server name and email addresses to match your corporation, enjoy!