<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MattLog.net &#187; StorageGroupCopyStatus</title>
	<atom:link href="http://mattlog.net/tag/storagegroupcopystatus/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattlog.net</link>
	<description>Matts Admin Tips</description>
	<lastBuildDate>Wed, 21 Jul 2010 01:37:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Auto Email when StorageGroupCopy Status Failed</title>
		<link>http://mattlog.net/2009/03/12/auto-email-when-storagegroupcopy-status-failed/</link>
		<comments>http://mattlog.net/2009/03/12/auto-email-when-storagegroupcopy-status-failed/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 05:22:14 +0000</pubDate>
		<dc:creator>Matt Shadbolt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SCR]]></category>
		<category><![CDATA[StorageGroupCopyStatus]]></category>

		<guid isPermaLink="false">http://mattlog.net/?p=129</guid>
		<description><![CDATA[Man! I&#8217;m killing these powershell scripts today &#8211; and they&#8217;ve all been related to alerting/reporting via email. If you&#8217;ve missed my two other posts &#8211; there is a mailbox size report (http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/) and a StorageGroupCopyStatus report (http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/) This one is a little more useful. Basically, this PowerShell script checks the SummaryCopyStatus and checks that it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Man! I&#8217;m killing these powershell scripts today &#8211; and they&#8217;ve all been related to alerting/reporting via email. If you&#8217;ve missed my two other posts &#8211; there is a mailbox size report (<a href="http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/">http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/</a>) and a StorageGroupCopyStatus report (<a href="http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/">http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/</a>)</p>
<p>This one is a little more useful.</p>
<p>Basically, this PowerShell script checks the SummaryCopyStatus and checks that it&#8217;s &#8220;Healthy&#8221; &#8211; if not, it will send an email reporting which Storage Group copy has failed.  You can run this script every hour or so, and be alerted when any SCR status has gone bad.</p>
<p>This is based on the same email code as my previous two posts. Bare in mind that I&#8217;m NOT a developer and my code is more than likely inefficient and ugly!</p>
<p>You can download the script <a href="http://mattlog.net/wp-content/uploads/2009/03/checkscrstatus.ps1">CheckSCRStatus.ps1</a></p>
<p>Or view the code:</p>
<p>$SCRStatus = Get-StorageGroupCopyStatus -Server PRIMARYSERVER -StandbyMachine SECONDARYSERVER | Where {$_.StorageGroupName -eq &#8220;First Storage Group&#8221;}<br />
if ($SCRStatus.SummaryCopyStatus -ne &#8220;Healthy&#8221;)<br />
{<br />
$MessageBody = &#8220;The SCR for &#8221; + $SCRStatus.StorageGroupName + &#8221; has failed&#8221;<br />
$FromAddress = &#8220;FromAddress@yourdomain.com&#8221;<br />
$ToAddress = &#8220;ToAddress@yourdomain.com&#8221;<br />
$MessageSubject = &#8220;SCR Status Failure&#8221;<br />
$SendingServer = &#8220;MAILSERVER&#8221;<br />
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody<br />
$SMTPMessage.IsBodyHtml = $true<br />
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer<br />
$SMTPClient.Send($SMTPMessage)<br />
}<br />
Else<br />
{<br />
Write-Host &#8220;First Storage Group All Good!&#8221;<br />
}<br />
$SCRStatus2 = Get-StorageGroupCopyStatus -Server PRIMARYSERVER -StandbyMachine SECONDARYSERVER | Where {$_.StorageGroupName -eq &#8220;Second Storage Group&#8221;}<br />
if ($SCRStatus2.SummaryCopyStatus -ne &#8220;Healthy&#8221;)<br />
{<br />
$MessageBody = &#8220;The SCR for &#8221; + $SCRStatus2.StorageGroupName + &#8221; has failed&#8221;<br />
$FromAddress = &#8220;FromAddress@yourdomain.com&#8221;<br />
$ToAddress = &#8220;ToAddress@yourdomain.com&#8221;<br />
$MessageSubject = &#8220;SCR Status Failure&#8221;<br />
$SendingServer = &#8220;MAILSERVER&#8221;<br />
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody<br />
$SMTPMessage.IsBodyHtml = $true<br />
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer<br />
$SMTPClient.Send($SMTPMessage)<br />
}<br />
Else<br />
{<br />
Write-Host &#8220;Second Storage Group All Good!&#8221;<br />
Exit<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://mattlog.net/2009/03/12/auto-email-when-storagegroupcopy-status-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Email Exchange 2007 StorageGroupCopyStatus</title>
		<link>http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/</link>
		<comments>http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 04:02:15 +0000</pubDate>
		<dc:creator>Matt Shadbolt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SCR]]></category>
		<category><![CDATA[Standby Continuous Replication]]></category>
		<category><![CDATA[StorageGroupCopyStatus]]></category>

		<guid isPermaLink="false">http://mattlog.net/?p=124</guid>
		<description><![CDATA[Exchange 2007&#8242;s Storage Group Copy feature is one of my favourites, however the one area it is really lacking is the reporting. You need to manually run the Get-StorageGroupCopyStatus -Server INITIALSERVER -StandbyMachine TARGETSERVER to find that your SCR is Healthy. I&#8217;ve been playing around writing some simple PowerShell scripts today so I thought I would [...]]]></description>
			<content:encoded><![CDATA[<p>Exchange 2007&#8242;s Storage Group Copy feature is one of my favourites, however the one area it is really lacking is the reporting. You need to manually run the Get-StorageGroupCopyStatus -Server INITIALSERVER -StandbyMachine TARGETSERVER to find that your SCR is Healthy.</p>
<p>I&#8217;ve been playing around writing some simple PowerShell scripts today so I thought I would fix the reporting problem Microsoft haven&#8217;t.</p>
<p>I&#8217;ve written a simple PS script that gets the Status(Health), Replay Queue Length, Last Replayed Time and Last Full Backup Time and emails it to a specified address in a HTML table. Just use Task Scheduler to run this daily and you will receive the status of your SCR clusters.</p>
<p>You can download the script here <a href="http://mattlog.net/wp-content/uploads/2009/03/emailstoragegroupcopystatusreport.ps1">EmailStorageGroupCopyStatusReport.ps1</a></p>
<p>Or view the script below:</p>
<p>#Replace the PRIMARYSERVER attribute with your production mail server, and the SECONDARYSERVER with your SCR replica<br />
$MessageBody = Get-StorageGroupCopyStatus -Server PRIMARYSERVER -StandbyMachine SECONDARYSERVER | Select @{Expression={$_.StorageGroupName};Name=&#8221;Storage Group&#8221;}, @{Expression={$_.SummaryCopyStatus};Name=&#8221;Status&#8221;}, @{Expression={$_.ReplayQueueLength};Name=&#8221;Replay Que Length&#8221;}, @{Expression={$_.LastReplayedLogTime};Name=&#8221;Last Replayed Time&#8221;}, @{Expression={$_.LatestFullBackupTime};Name=&#8221;Last Full Backup&#8221;} | ConvertTo-Html</p>
<p>#Enter your mail server details<br />
$FromAddress = &#8220;FromAddress@YourDomain.com&#8221;<br />
$ToAddress = &#8220;ToAddress@YourDomain.com&#8221;<br />
$MessageSubject = &#8220;Exch07 SCR Status&#8221;<br />
$SendingServer = &#8220;MAILSERVER&#8221;<br />
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody<br />
$SMTPMessage.IsBodyHtml = $true<br />
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer<br />
$SMTPClient.Send($SMTPMessage)<br />
#Written by Matt Shadbolt<br />
#http://www.mattlog.net</p>
]]></content:encoded>
			<wfw:commentRss>http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
