Send a daily html CCR report via Powershell
Create a powershell script to generate the html file
Test-ReplicationHealth | ConvertTo-Html -title “BackupReport CCR” -body “Backup status per Storage Group” | Set-Content E:\StorageGroupBackupStatus.html
note:
test-servicehealth
Create a powershell script to e-mail log file
$filename = “E:\StorageGroupBackupStatus.html”
$smtpServer = “RelayServer”
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($filename)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = “from@emailaddress.com”
$msg.To.Add(“to@emailaddress.com”)
$msg.Subject = “CCR Status”
$msg.Body = “Attached is the CCR status”
$msg.Attachments.Add($att)
$smtp.Send($msg)
Go into task scheduler
For the program type this
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
For the arguments use
-PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1″ -noexit -command “. ‘e:\SendLogFile.ps1′”