Skip to content

Instantly share code, notes, and snippets.

Created May 14, 2013 23:55
Show Gist options
  • Save anonymous/5580684 to your computer and use it in GitHub Desktop.
Save anonymous/5580684 to your computer and use it in GitHub Desktop.
$logs = 'c:\windows\system32\ccm\logs\smstslog'
if (-not (test-path $logs))
{
exit 0
}
$tsenv = new-object -comobject Microsoft.SMS.TSEnvironment
$computer = ""
if ($tsenv -ne $null)
{
$computer = $tsenv.Value('OSDComputerName')
}
else
{
$computer = hostname
}
$body = 'An OS install has completed <br/><br/>'
$body += 'Model: ' + (Get-WmiObject win32_computersystem).Model + '<br/>'
$body += 'Serial: ' + (Get-wmiobject win32_bios).SerialNumber + '<br/>'
if ($tsenv -ne $null)
{
$body += 'IP: ' + $tsenv.Value('OSDAdapter0IPAddressList') + '<br/>'
$body += 'MAC: ' + $tsenv.Value('OSDAdapter0MacAddress') + '<br/>'
}
$mail = new-object system.net.mail.mailmessage
the rest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment