Send an Email if OSD fails


You can send an email if OSD fails on a Pc. Get the “SendMail.ps1” here and save the script on the SCCM server.

Changes the following lines in the script:

1. Add you from email address in line 7
2. Add you email address in line 9
3. Add the SMTP server in line 11

We are going to use status filtering rules to look for Message ID “11170”. This means that OSD have failed. Follow these step to set it up in SCCM:

1. Open the SCCM console and navigate to: Administration –> Site Configuration –> Sites
image

2. Right click on you Primary site and choose “Status Filter Rules”
image

3. Click “Create…” to create aa new rule

4. On the general tab gibe it a name. Mark “Source” and choose “Client”. Mark Message ID and write “11170”
image

5. On the Action tab mark “Run a program” and put in the path to PowerShell, SendMail script and the name of the task sequence. In this examble: “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file D:\Install\SendMail.ps1 -ComputerName %msgsys -TS “Microsoft Windows Deployment””. Click “Ok”
image

SCCM will now send an email every time a Pc fail during OSD.