Exchange SCR Health Script

Posted by in Exchange, PowerShell

Download the script here: Get-SCRHealth.ps1

In the same way that Standby Continuous Replication (SCR) has to be configured using the Exchange Management Shell, it can also only be managed and monitored through the Shell too.

I’m not sure how many people this will help as Exchange 2007 isn’t the latest and greatest but I’ve created a script to keep me updated with the state of my storage groups configured with Standby Continuous Replication (SCR).

The script should work out of the box in any 2007 environment as it finds the SCR replicas using the Get-StorageGroup cmdlet:

Get-StorageGroup | ? {$_.StandbyMachines} | Select * -Expand StandbyMachines

The script output can be presented in three ways; at the console, in an email and in an HTML report.

To run the script and just show the output at the command line just run the script:

[PS] D:\Scripts .\Get-SCRHealth.ps1

SCR Health Check Script running from the Shell...

Two switches are available in the script to push the output out in an email or in an HTML file. The HTML file can be used on a monitoring screen for example:

-Email $true|$false
-Report $true|$false

The two switches can be run together to get the output at the console, in an email and in an HTML report concurrently.

So for example:

[PS] D:\Scripts .\Get-SCRHealth.ps1 -Email $true -Report $true

Email:

SCR Health Check Script Email...

Report:

SCR Health Check Script Report...

Once you’ve downloaded the script you’ll need to change a few variables for your environment. They can be found near the top of the script:

# Variables
$ReportPath = "D:\Temp\Report.htm"
$EmailSubject = "Exchange SCR Report"
$FromAddress = "donotreply@domain.com"
$RecipientAddress = "yourname@domain.com" # Comma separate for more than one.
$SMTPServer = "your.mail.relay.com" # Hostname or IP Address.

Download the script here: Get-SCRHealth.ps1