Velocity Technical Archive
Send a daily html CCR report via Powershell
Published 2009-11-02 • Blog, Exchange
Archived Reference: This is a historical technical article preserved from the Velocity Technologies knowledge base. For current Phoenix and East Valley managed IT services, explore our managed IT services or cybersecurity solutions.
Create a powershell script to generate the html file
\n
Test-ReplicationHealth | ConvertTo-Html -title "BackupReport CCR" -body "Backup status per Storage Group" | Set-Content E:StorageGroupBackupStatus.html\nnote:\n
test-systemhealth
\n
test-servicehealth\n \n\n
Create a powershell script to e-mail log file
\n$filename = “E:StorageGroupBackupStatus.html”\n$smtpServer = “RelayServer”\n$msg = new-object Net.Mail.MailMessage\n$att = new-object Net.Mail.Attachment($filename)\n$smtp = new-object Net.Mail.SmtpClient($smtpServer)\n$msg.From =
“[email protected]”\n$msg.To.Add(
“[email protected]”)\n$msg.Subject = “CCR Status”\n$msg.Body = “Attached is the CCR status”\n$msg.Attachments.Add($att)\n$smtp.Send($msg)\n
Go into task scheduler
\nFor the program type this\n
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe\nFor the arguments use\n
-PSConsoleFile "C:Program FilesMicrosoftExchange Serverbinexshell.psc1" -noexit -command ". 'e:SendLogFile.ps1'"