First off this is an updated script from Jason Rydstrand’s SCOM 2007 R2 daily check script. If you would like to check out the original please see http://blogs.technet.com/b/jasonrydstrand/archive/2013/03/27/daily-scom-health-check-with-powershell.aspx
I’ve updated the commandlets so it can be used for SCOM 2012 and SCOM 2012 R2. This script is intended to use Gmail as the mail delivery method. It can be easily changed to use other email systems but I’ll save that for a future article. The only part that will need to be modified is the following:
$UserName is your Gmail email account
$Password is your Gmail password
$mailmessage.from is who the email will be coming from
$mailmessage.To.Add can be any additional people you would like to send this email to.
Script is available for download at Microsoft TechNet Script Gallery: http://gallery.technet.microsoft.com/scriptcenter/SCOM-2012-Daily-Health-5950d801