Created
May 14, 2013 23:55
-
-
Save anonymous/5580684 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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