<?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>Exchange Server Pro &#187; Exchange Management Shell</title>
	<atom:link href="http://exchangeserverpro.com/tag/exchange-management-shell/feed" rel="self" type="application/rss+xml" />
	<link>http://exchangeserverpro.com</link>
	<description>Microsoft Exchange Server News - Tips - Tutorials</description>
	<lastBuildDate>Fri, 03 Feb 2012 12:36:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>PowerShell Script: Check Exchange 2010 Database Backups</title>
		<link>http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups</link>
		<comments>http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups#comments</comments>
		<pubDate>Sun, 06 Nov 2011 11:23:58 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4227</guid>
		<description><![CDATA[A PowerShell script that can be used to monitor the backup time stamps on Exchange Server 2010 databases.]]></description>
			<content:encoded><![CDATA[<p>In almost any <a href="http://exchangeserverpro.com">Exchange Server 2010</a> environment there will be a good reason for adding some additional monitoring of backups.</p>
<p>Perhaps the environment is large enough that the backups are managed by a separate team to the Exchange administrators, and so the Exchange admins just want to keep an eye on their database backups. Or even in a smaller environment the administrators may just want to be sure that their backup software isn&#8217;t reporting successful backups when in fact they may be failing.</p>
<p>In this post I will demonstrate a PowerShell script that you can run in an Exchange Server 2010 environment to report on any databases that have not successfully backed up in the last 48 hours. Let&#8217;s take a look at how this works.</p>
<p>Firstly, backup time stamps are retrievable using the <a href="http://technet.microsoft.com/en-us/library/bb124924.aspx">Get-MailboxDatabase</a> cmdlet for mailbox databases, or <a href="http://technet.microsoft.com/en-us/library/aa998827.aspx">Get-PublicFolderDatabase</a> for public folder databases. Here is an example:</p>
<pre>PS C:\Scripts&gt; Get-MailboxDatabase -Status | ft name,last* -auto

Name     LastFullBackup       LastIncrementalBackup LastDifferentialBackup LastCopyBackup
----     --------------       --------------------- ---------------------- --------------
MB-HO-01 11/6/2011 1:40:19 PM
MB-HO-02
MB-HO-03
MB-BR-01</pre>
<p>You can see that one of the databases above has been backed up, but the others have not. In a script that checks both mailbox and public folder databases we could use this code to generate the report.</p>
<pre>$dbs = Get-MailboxDatabase -Status
$dbs = $dbs += Get-PublicFolderDatabase -Status
$dbs | ft name,last*</pre>
<p>Now we can see both the mailbox and the public folder databases.</p>
<pre>Name                    LastFullBackup          LastIncrementalBackup   LastDifferentialBackup  LastCopyBackup
----                    --------------          ---------------------   ----------------------  --------------
MB-HO-01                11/6/2011 1:40:19 PM
MB-HO-02
MB-HO-03
MB-BR-01
PF-HO-01                11/6/2011 1:40:20 PM
PF-BR-01</pre>
<p>It would be a simple matter to run that command and read the output every single day, but that would not be the most efficient way of checking database backups. There could be dozens or even hundreds of databases in that output, and we&#8217;d have to mentally perform the calculations to determine whether the backup time stamp is within the last 48 hours or not.</p>
<p>Instead we want to only to see databases that have not been backed up within the 48 hour threshold. To do this we can use some <a href="http://technet.microsoft.com/en-us/library/ff730960.aspx">date maths</a>. Because we&#8217;ve already retrieved the database objects into a collection called <strong>$dbs</strong> we can loop through them to perform the date calculations like this. Note that in this example only <a href="http://exchangeserverpro.com/introduction-to-exchange-server-2010-backup-and-recovery">Full and Incremental backups</a> are being considered.</p>
<pre>foreach ($db in $dbs)
{
	Write-Host -ForegroundColor Gray "Checking" $db.name"..."

	$lastbackup = @{}
	$ago = @()
	[bool]$alertflag = $false

	if ( $db.LastFullBackup -eq $nul -and $db.LastIncrementalBackup -eq $nul)
	{
		$lastbackup.time = "Never"
		$lastbackup.type = "Never"
		[string]$ago = "Never"
	}
	elseif ( $db.LastFullBackup -lt $db.LastIncrementalBackup )
	{
		$lastbackup.time = $db.LastIncrementalBackup
		$lastbackup.type = "Incremental"
		[int]$ago = ($now - $lastbackup.time).TotalHours
		$ago = "{0:N0}" -f $ago
	}
	elseif ( $db.LastIncrementalBackup -lt $db.LastFullBackup )
	{
		$lastbackup.time = $db.LastFullBackup
		$lastbackup.type = "Full"
		[int]$ago = ($now - $lastbackup.time).TotalHours
		$ago = "{0:N0}" -f $ago
	}
}</pre>
<p>One of three possible scenarios will be true:</p>
<ul>
<li>If the database has not been backed up at all then both Full and Incremental time stamps will be nul, so all of the resulting values are set to &#8220;Never&#8221;</li>
<li>If the most recent backup was an Incremental then the type is set to &#8220;Incremental&#8221; and the <strong>$ago</strong> variable is set to the number of hours that has passed since that Incremental backup finished</li>
<li>If the most recent backup was a Full then the type is set to &#8220;Full&#8221; and the <strong>$ago</strong> variable is set to the number of hours that has passed since that Full backup finished</li>
</ul>
<p>Now, because we&#8217;re only interested in databases that haven&#8217;t backed up in the last 48 hours (or have never been backed up at all) we can compare the $ago variable to our threshold of 48 hours, and if an alert needs to be raised set the alert flag to <strong>True</strong> and create an object with all of the desired information for our report.</p>
<pre>if ( $ago -gt $threshold -or $ago -eq "Never")
	{
		$alertflag = $true
		$dbObj = New-Object PSObject
		$dbObj | Add-Member NoteProperty -Name "Server/DAG" -Value $db.MasterServerOrAvailabilityGroup
		$dbObj | Add-Member NoteProperty -Name "Database" -Value $db.name
		$dbObj | Add-Member NoteProperty -Name "Database Type" -Value $dbtype
		$dbObj | Add-Member NoteProperty -Name "Last Backup Type" -Value $lastbackup.type
		$dbObj | Add-Member NoteProperty -Name "Hrs Ago" -Value $ago
		$dbObj | Add-Member NoteProperty -Name "Time Stamp" -Value $lastbackup.time
		$alerts = $alerts += $dbObj
	}</pre>
<p>That code actually goes inside the <a href="http://technet.microsoft.com/en-us/library/ee176828.aspx">ForEach loop</a> for the $dbs collection.</p>
<p>The final piece of the script is the report itself. We output it based on whether the alert flag is set to True or False.</p>
<pre>if ($alertflag = $true )
{
	Write-Host "The following databases have not been backed up in" $threshold "hours."
	$alerts | ft -AutoSize
}
else
{
	Write-Host "No backup alerts required."
}</pre>
<p>This example outputs the report to the PowerShell window but you could write your <a href="http://exchangeserverpro.com/powershell-how-to-send-email">PowerShell script to send an email report</a> instead if you wish.</p>
<p>Here is an example report:</p>
<pre>PS C:\Scripts&gt; .\Check-DatabaseBackups.ps1
Getting database list...
Checking MB-HO-01 ...
Checking MB-HO-02 ...
Checking MB-HO-03 ...
Checking MB-BR-01 ...
Checking PF-HO-01 ...
Checking PF-BR-01 ...
The following databases have not been backed up in 48 hours.

Server/DAG     Database Database Type Last Backup Type Hrs Ago Time Stamp
----------     -------- ------------- ---------------- ------- ----------
dag-headoffice MB-HO-02 Mailbox       Never            Never   Never
dag-headoffice MB-HO-03 Mailbox       Never            Never   Never
BR-EX2010-MB   MB-BR-01 Mailbox       Never            Never   Never
BR-EX2010-MB   PF-BR-01 Public Folder Never            Never   Never</pre>
<p>And here is the complete script.</p>
<pre>#
#.SYNOPSIS
#Checks the backup timestamps for the servers
#and alerts if a database hasn't been backed up
#in the last 48 hours
#
#.EXAMPLE
#.\Check-DatabaseBackups.ps1
#

#...................................
# Variables
#...................................

$ErrorActionPreference = "SilentlyContinue"
$WarningPreference = "SilentlyContinue"

$alerts = @()
[int]$threshold = 48

$now = [DateTime]::Now

#...................................
# Script
#...................................

#Get all Mailbox and Public Folder databases
Write-Host -ForegroundColor Gray "Getting database list..."
$dbs = Get-MailboxDatabase -Status
$dbs = $dbs += Get-PublicFolderDatabase -Status

#Check each database for most recent backup
foreach ($db in $dbs)
{
	Write-Host -ForegroundColor Gray "Checking" $db.name"..."

	$lastbackup = @{}
	$ago = @()
	[bool]$alertflag = $false

	if ( $db.LastFullBackup -eq $null -and $db.LastIncrementalBackup -eq $nul)
	{
		$lastbackup.time = "Never"
		$lastbackup.type = "Never"
		[string]$ago = "Never"
	}
	elseif ( $db.LastFullBackup -lt $db.LastIncrementalBackup )
	{
		$lastbackup.time = $db.LastIncrementalBackup
		$lastbackup.type = "Incremental"
		[int]$ago = ($now - $lastbackup.time).TotalHours
		$ago = "{0:N0}" -f $ago
	}
	elseif ( $db.LastIncrementalBackup -lt $db.LastFullBackup )
	{
		$lastbackup.time = $db.LastFullBackup
		$lastbackup.type = "Full"
		[int]$ago = ($now - $lastbackup.time).TotalHours
		$ago = "{0:N0}" -f $ago
	}

	if ($db.IsMailboxDatabase -eq $true) {$dbtype = "Mailbox"}
	if ($db.IsPublicFolderDatabase -eq $true) {$dbtype = "Public Folder"}

	#If backup time stamp older than threshold set alert flag and create object for alerting
	if ( $ago -gt $threshold -or $ago -eq "Never")
	{
		$alertflag = $true
		$dbObj = New-Object PSObject
		$dbObj | Add-Member NoteProperty -Name "Server/DAG" -Value $db.MasterServerOrAvailabilityGroup
		$dbObj | Add-Member NoteProperty -Name "Database" -Value $db.name
		$dbObj | Add-Member NoteProperty -Name "Database Type" -Value $dbtype
		$dbObj | Add-Member NoteProperty -Name "Last Backup Type" -Value $lastbackup.type
		$dbObj | Add-Member NoteProperty -Name "Hrs Ago" -Value $ago
		$dbObj | Add-Member NoteProperty -Name "Time Stamp" -Value $lastbackup.time
		$alerts = $alerts += $dbObj
	}
}

#If alert flag is true output the report
if ($alertflag = $true )
{
	Write-Host "The following databases have not been backed up in" $threshold "hours."
	$alerts | ft -AutoSize
}
else
{
	Write-Host "No backup alerts required."
}</pre>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/set-automated-exchange-2010-database-backup-alert-email" title="How to Set Up an Automated Exchange 2010 Database Backup Alert Email">How to Set Up an Automated Exchange 2010 Database Backup Alert Email</a></li><li><a href="http://exchangeserverpro.com/powershell-configuring-settings-multiple-exchange-mailbox-databases" title="PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases">PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases</a></li><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-mailbox-database-backup-time" title="PowerShell Script: Check Exchange Mailbox Database Last Backup Time">PowerShell Script: Check Exchange Mailbox Database Last Backup Time</a></li><li><a href="http://exchangeserverpro.com/test-mailflow-exchange-2003-servers" title="Using Test-Mailflow with Exchange 2003 Servers">Using Test-Mailflow with Exchange 2003 Servers</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups">PowerShell Script: Check Exchange 2010 Database Backups</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Test-ServiceHealth for Exchange Server Health Checks</title>
		<link>http://exchangeserverpro.com/exchange-2010-test-servicehealth</link>
		<comments>http://exchangeserverpro.com/exchange-2010-test-servicehealth#comments</comments>
		<pubDate>Tue, 18 Oct 2011 12:04:32 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Diagnostics]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Test-ServiceHealth]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4185</guid>
		<description><![CDATA[Learn how to build a PowerShell script that uses Test-ServiceHealth to perform health checks on your Exchange servers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://exchangeserverpro.com">Exchange Server 2010</a> (and 2007 for that matter) ships with a useful PowerShell cmdlet called <a href="http://technet.microsoft.com/en-us/library/aa998852.aspx">Test-ServiceHealth</a>.</p>
<p>As the name suggests, Test-ServiceHealth checks the state of the services that should be running on the Exchange server. One of the best things about this cmdlet is that it checks the services depending on the <a href="http://exchangeserverpro.com/exchange-2010-server-roles">Exchange server roles</a> that are installed.</p>
<p>So for example, for a Hub Transport server only those services relating to the Hub Transport role will be checked. While for a &#8220;typical&#8221; Exchange 2010 server the services for the Hub Transport, Client Access, and Mailbox server roles will be checked.</p>
<p>Here is an example of the Test-ServiceHealth results.</p>
<pre>[PS] C:\&gt;Test-ServiceHealth br-ex2010-mb

Role                    : Mailbox Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeIS, MSExchangeMailboxAssistants, MSExchangeMailSub
                          mission, MSExchangeRepl, MSExchangeRPC, MSExchangeSA, MSExchangeSearch, MSExchangeServiceHost
                          , MSExchangeThrottling, MSExchangeTransportLogSearch, W3Svc, WinRM}
ServicesNotRunning      : {}

Role                    : Client Access Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeAB, MSExchangeADTopology, MSExchangeFBA, MSExchangeFDS, MSExchangeMailbo
                          xReplication, MSExchangeProtectedServiceHost, MSExchangeRPC, MSExchangeServiceHost, W3Svc, Wi
                          nRM}
ServicesNotRunning      : {}

Role                    : Hub Transport Server Role
RequiredServicesRunning : True
ServicesRunning         : {IISAdmin, MSExchangeADTopology, MSExchangeEdgeSync, MSExchangeServiceHost, MSExchangeTranspo
                          rt, MSExchangeTransportLogSearch, W3Svc, WinRM}
ServicesNotRunning      : {}</pre>
<p>As you can see that is a lot of useful information. But whenever possible I like to see just the minimum relevant information for my servers. In the case of Test-ServiceHealth the RequiredServicesRunning result is the thing I am most interested in.</p>
<p>So in this case I could run the following command to see just that information:</p>
<pre>[PS] C:\&gt;Test-ServiceHealth br-ex2010-mb | ft Role,RequiredServicesRunning -auto

Role                      RequiredServicesRunning
----                      -----------------------
Mailbox Server Role                          True
Client Access Server Role                    True
Hub Transport Server Role                    True</pre>
<p>Much better.</p>
<p>Now suppose I wanted to run that for all of my Exchange servers. I could do that with the following command:</p>
<pre>[PS] C:\&gt;Get-ExchangeServer | Test-ServiceHealth | ft Role,RequiredServicesRunning -auto

Role                      RequiredServicesRunning
----                      -----------------------
Client Access Server Role                    True
Hub Transport Server Role                    True
Client Access Server Role                    True
Hub Transport Server Role                    True
Mailbox Server Role                         False
Mailbox Server Role                          True
Client Access Server Role                    True
Hub Transport Server Role                    True
Mailbox Server Role                          True
Client Access Server Role                    True
Hub Transport Server Role                    True</pre>
<p>Interesting, especially the one that failed the test for the Mailbox server role. But in that output I can&#8217;t tell which server failed.</p>
<p>Let&#8217;s try this instead:</p>
<pre>[PS] C:\&gt;$servers = Get-ExchangeServer
[PS] C:\&gt;foreach ($server in $servers) {
&gt;&gt; Write-Host "Checking" $server.name
&gt;&gt; Test-ServiceHealth $server | ft Role,RequiredServicesRunning -auto
&gt;&gt; }
&gt;&gt;</pre>
<p>Now we get output that is a little more useful, and tells me which server failed the test.</p>
<pre>Checking HO-EX2010-CAHT1

Role                      RequiredServicesRunning
----                      -----------------------
Client Access Server Role                    True
Hub Transport Server Role                    True

Checking HO-EX2010-CAHT2

Role                      RequiredServicesRunning
----                      -----------------------
Client Access Server Role                    True
Hub Transport Server Role                    True

Checking HO-EX2010-MB1

Role                RequiredServicesRunning
----                -----------------------
Mailbox Server Role                   False

Checking HO-EX2010-MB2

Role                RequiredServicesRunning
----                -----------------------
Mailbox Server Role                    True

Checking BR-EX2010-CAHT

Role                      RequiredServicesRunning
----                      -----------------------
Client Access Server Role                    True
Hub Transport Server Role                    True

Checking BR-EX2010-MB

Role                      RequiredServicesRunning
----                      -----------------------
Mailbox Server Role                          True
Client Access Server Role                    True
Hub Transport Server Role                    True</pre>
<p>But it still isn&#8217;t quite enough, so let&#8217;s wrap this up into a handy script that will do the following:</p>
<ul>
<li>Run Test-SystemHealth for all of the Exchange servers in the organization</li>
<li>Tell me which servers passed the test</li>
<li>Tell me which servers failed the test, and why</li>
</ul>
<p>Here is the script code that will perform those steps.</p>
<pre>#Get the list of Exchange servers in the organization
$servers = Get-ExchangeServer

#Loop through each server
ForEach ($server in $servers)
{
	Write-Host -ForegroundColor White "---------- Testing" $server

	#Initialize an array object for the Test-ServiceHealth results
	[array]$servicehealth = @()

	#Run Test-ServiceHealth
	$servicehealth = Test-ServiceHealth $server

	#Output the results
	ForEach($serverrole in $servicehealth)
	{
		If ($serverrole.RequiredServicesRunning -eq $true)
		{
			Write-Host $serverrole.Role -NoNewline; Write-Host -ForegroundColor Green "Pass"
		}
		Else
		{
			Write-Host $serverrole.Role -nonewline; Write-Host -ForegroundColor Red "Fail"
			[array]$notrunning = @()
			$notrunning = $serverrole.ServicesNotRunning
			ForEach ($svc in $notrunning)
			{
				$alertservices += $svc
			}
			Write-Host $serverrole.Role "Services not running:"
			ForEach ($al in $alertservices)
				{
					Write-Host -ForegroundColor Red `t$al
				}
		}
	}
}</pre>
<p>The output from running the script will look something like this.</p>
<p><img class="aligncenter size-full wp-image-4186" title="exchange-2010-test-servicehealth-script" src="http://exchangeserverpro.com/wp-content/uploads/2011/10/exchange-2010-test-servicehealth-script.jpg" alt="" width="539" height="267" /></p>
<p>You can now see at a glance which servers have passed the test, which ones failed, and which services aren&#8217;t running for the servers that failed.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/list-users-access-exchange-mailboxes" title="How to List all Users Who Have Access to Other Exchange Mailboxes">How to List all Users Who Have Access to Other Exchange Mailboxes</a></li><li><a href="http://exchangeserverpro.com/clone-mailbox-database-configuration" title="Exchange 2007/2010: How to Clone a Mailbox Database Configuration">Exchange 2007/2010: How to Clone a Mailbox Database Configuration</a></li><li><a href="http://exchangeserverpro.com/exchange-2007-2010-public-folder-store-inconsistent-state" title="Exchange 2007/2010 Public Folder Store in an Inconsistent State">Exchange 2007/2010 Public Folder Store in an Inconsistent State</a></li><li><a href="http://exchangeserverpro.com/powershell-configuring-settings-multiple-exchange-mailbox-databases" title="PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases">PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth">Using Test-ServiceHealth for Exchange Server Health Checks</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/exchange-2010-test-servicehealth/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Case of the 24,368 Read Receipts</title>
		<link>http://exchangeserverpro.com/real-world-case-read-receipts</link>
		<comments>http://exchangeserverpro.com/real-world-case-read-receipts#comments</comments>
		<pubDate>Thu, 25 Aug 2011 14:08:19 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[Mailbox]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3977</guid>
		<description><![CDATA[An Exchange 2007 real world situation in which a mailbox clean up inadvertently generated thousands of read receipts.]]></description>
			<content:encoded><![CDATA[<p>I often share real world examples of problems or scenarios that you might encounter with <a href="http://exchangeserverpro.com">Microsoft Exchange Server</a>, and how to avoid or resolve them.</p>
<p>In this article I want to share one such example that happened to me under a specific set of conditions.</p>
<p>The scenario begins with a mailbox migration project, in which I encountered a very large mailbox. The mailbox was too large to move without risking filling up the transaction log volume on the destination server. So I tracked down an owner of the mailbox to discuss options for removing some of the older items.</p>
<p>As it turns out they didn&#8217;t really need to keep any of the items in that mailbox that were older than about 30 days. So more than 2 years and 300,000 items in there were not required. We agreed to delete everything older than 6 months, just to be safe.</p>
<p><em><strong>Side Note</strong> - keep an eye on your &#8220;large mailboxes&#8221; reports and you&#8217;ll often find these generic mailboxes that get set up as a place to catch copies of email &#8220;just in case&#8221; it is needed some time in the future. Often it isn&#8217;t.</em></p>
<p>So my next task was to delete the email content that was no longer needed. I considered using the Exchange 2007 <a href="http://technet.microsoft.com/en-us/library/aa998579(EXCHG.80).aspx">Export-Mailbox</a> cmdlet for this task, but decided to just use Outlook instead since I was already planning to use Outlook to take a look at some of the items before I deleted them.</p>
<p>I logged into a Citrix desktop, launched Outlook, and added the mailbox as a secondary mailbox. I had decided to use Outlook in a Citrix desktop because I expected it to hang for long periods of time as it enumerated or deleted the thousands of items I would be handling, and wanted to keep using Outlook on my laptop as normal.</p>
<p>So over the course of about two days in between other daily tasks I performed Outlook searches based on date ranges, and deleted the items in blocks of about 10,000 messages at a time. It is important to note at this stage that I was using <strong>Advanced Find</strong> to search the secondary mailbox.</p>
<p><img class="aligncenter size-full wp-image-3979" title="deleting-email-read-receipt-2" src="http://exchangeserverpro.com/wp-content/uploads/2011/08/deleting-email-read-receipt-2.jpg" alt="" width="351" height="316" /></p>
<p>After doing a search based on received date (ie, I started with the oldest mail and worked my way forward month by month) I would then select all the email that appeared in the results and delete them.</p>
<p><img class="aligncenter size-full wp-image-3980" title="deleting-email-read-receipt-3" src="http://exchangeserverpro.com/wp-content/uploads/2011/08/deleting-email-read-receipt-3.jpg" alt="" width="580" height="368" />When you delete an email from a secondary mailbox it often gets moved to your own mailbox&#8217;s Deleted Items. However when you delete an email from a secondary mailbox <em>via an Advanced Find dialog</em>, it often goes into the Deleted Items of the secondary mailbox.</p>
<p>I say &#8220;often&#8221; because in at least one test the mail went to the Deleted Items of the primary mailbox, but in every other test it went to the secondary mailbox. It may be that Outlook behaves inconsistently in this situation, or that one test was different in some way that I can&#8217;t recall now.</p>
<p>As I said earlier I deleted around 2 years worth of unwanted email from the mailbox, in blocks of about 10,000 messages. When I had deleted everything up to the cut off date I&#8217;d agreed to with the mailbox owner I went ahead and simply emptied the Deleted Items of the secondary mailbox.</p>
<p><img class="aligncenter size-full wp-image-3982" title="deleting-email-read-receipt-5" src="http://exchangeserverpro.com/wp-content/uploads/2011/08/deleting-email-read-receipt-5.jpg" alt="" width="347" height="209" /></p>
<p>Job done. My plan was to wait for the deleted items to purge from the database itself overnight and then schedule a time to move what was now a much smaller mailbox.</p>
<p>A relevant bit of information at this point is that all of the email I deleted from the mailbox, and then emptied from the Deleted Items, was actually <em>unread email</em>. Nobody ever read these emails, they were there &#8220;just in case&#8221;.</p>
<p>That fact sprang immediately into my mind when about an hour later I was speaking with an external party who had received an email from our server that read something like this:</p>
<blockquote><p>Subject: <strong>Not read:</strong> [subject line of original email]</p>
<p>From: [the large mailbox I'd been cleaning up]</p>
<p>Date: [right about the same time I emptied the Deleted Items]</p></blockquote>
<p>I quickly learned that the person I was speaking to, when they originally sent their email to our server, <strong>had requested a read receipt</strong>.</p>
<p>The email had sat in the mailbox for several months unread, and then I came along and deleted it. The Exchange Server then honoured the receipt request, and sent the original sender the &#8220;Not read&#8221; message.</p>
<p><strong>I had just deleted slightly over 150,000 email messages from that mailbox. How many of them had requested read receipts?</strong></p>
<p>I ran message tracking log searches of the Hub Transport servers and got my first answer &#8211; <em>a lot</em>.</p>
<p>I dumped the log data to a file and filtered it a few different ways to discover that:</p>
<ul>
<li>About 24,368 &#8220;Not read&#8221; read receipts had been generated (based on unique message ID)</li>
<li>They had gone out to about 1200 unique external email addresses</li>
</ul>
<p>The horse had well and truly bolted on this one, and my team leader started calling and emailing different customer service teams to give them a heads up in case they received calls from confused people about a sudden burst of &#8220;Not read&#8221; emails. Meanwhile I started digging into the technical side of things to try and find out what had gone wrong, and more importantly how we could avoid this happening again.</p>
<p>After quite a bit of testing here is what I have determined so far.</p>
<h2>Outlook 2003</h2>
<p>When permanently deleting an unread item by emptying the Deleted Items of a secondary mailbox Outlook 2003, even if configured to prompt for sending of read receipts, will not warn or prompt the user and a &#8220;Not read&#8221; message will be generated to the original sender.</p>
<h2>Outlook 2007</h2>
<p>When permanently deleting an unread item by emptying the Deleted Items of a secondary mailbox Outlook 2007, if configured to prompt for sending of read receipts, will display a dialog box asking if the receipt should be sent.</p>
<p><img class="aligncenter size-full wp-image-3978" title="deleting-email-read-receipt-1" src="http://exchangeserverpro.com/wp-content/uploads/2011/08/deleting-email-read-receipt-1.jpg" alt="" width="454" height="152" /></p>
<p>If Outlook 2007 is configured to never prompt, and to always send read receipts, a receipt will be generated to the original sender as with Outlook 2003.</p>
<p><img class="aligncenter size-full wp-image-3984" title="deleting-email-read-receipt-7" src="http://exchangeserverpro.com/wp-content/uploads/2011/08/deleting-email-read-receipt-7.jpg" alt="" width="456" height="533" /></p>
<p>If Outlook 2007 is configured to never send a response, then no receipt is generated to the original sender.</p>
<h2>Exchange Management Shell</h2>
<p>So what about if I had gone with my original thought to use the Export-Mailbox cmdlet to do the job? It certainly would have taken less time to delete all of the email, but what about the &#8220;Not read&#8221; receipts?</p>
<p>As it turns out, according to my testing, the Export-Mailbox cmdlet will in fact cause a &#8220;Not read&#8221; receipt to be generated if it deletes an item that is unread and for which the original sender requested a read receipt.</p>
<p>So had I gone with my original thought it would have had the same outcome as the manual process I used instead.</p>
<p>In fact the only scenario in which the receipts would not have been generated is if I had used Outlook 2007 (our Citrix desktops still run Outlook 2003 unfortunately) and had first checked that the tracking options were set to &#8220;Never send a response&#8221;.</p>
<p>I&#8217;m curious whether the receipts would have been generated if I had used Export-Mailbox to export to PST first, and then simply deleted the PST file. That is something I still need to test.</p>
<p>I also have not tested Outlook 2010 though I suspect it will be the same as Outlook 2007.</p>
<h2>Summary</h2>
<p>The lessons I took away from this incident were:</p>
<ul>
<li>Watch for creation of these types of &#8220;just in case&#8221; mailboxes that aren&#8217;t actually required</li>
<li>When they are required, make sure a maintenance routine is in place to manage their size</li>
<li>If using Outlook to delete bulk unread items, check first that read receipts are turned off in the tracking options</li>
</ul>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/error-outlook-unable-recover-items-folder" title="Error: Outlook Was Unable to Recover Some or All of the Items in this Folder">Error: Outlook Was Unable to Recover Some or All of the Items in this Folder</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/list-users-access-exchange-mailboxes" title="How to List all Users Who Have Access to Other Exchange Mailboxes">How to List all Users Who Have Access to Other Exchange Mailboxes</a></li><li><a href="http://exchangeserverpro.com/clone-mailbox-database-configuration" title="Exchange 2007/2010: How to Clone a Mailbox Database Configuration">Exchange 2007/2010: How to Clone a Mailbox Database Configuration</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/real-world-case-read-receipts">The Case of the 24,368 Read Receipts</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/real-world-case-read-receipts/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PowerShell Tip: Search for Commands by Keyword</title>
		<link>http://exchangeserverpro.com/powershell-tip-find-commands</link>
		<comments>http://exchangeserverpro.com/powershell-tip-find-commands#comments</comments>
		<pubDate>Tue, 16 Aug 2011 12:30:10 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3914</guid>
		<description><![CDATA[How to use PowerShell to search for Exchange Server 2010 management shell commands by keyword.]]></description>
			<content:encoded><![CDATA[<p>Here is a PowerShell tip that I rely on quite a lot. Sometimes I will have an admin task to perform but I can&#8217;t think of the exact PowerShell command to use. For example I know I want to perform some calendar administration, but I don&#8217;t remember the correct command.</p>
<p>Thanks to <a href="http://technet.microsoft.com/en-us/library/dd347726.aspx">Get-Command</a> I can quickly search for commands based on keywords. For example, to find all of the cmdlets with the keyword &#8220;calendar&#8221; in them:</p>
<pre>
[PS] C:\>Get-Command -Noun *calendar*

CommandType     Name                                                Definition
-----------     ----                                                ----------
Function        Get-CalendarDiagnosticLog                           ...
Function        Get-CalendarNotification                            ...
Function        Get-CalendarProcessing                              ...
Function        Get-MailboxCalendarConfiguration                    ...
Function        Get-MailboxCalendarFolder                           ...
Function        Set-CalendarNotification                            ...
Function        Set-CalendarProcessing                              ...
Function        Set-MailboxCalendarConfiguration                    ...
Function        Set-MailboxCalendarFolder                           ...
Function        Test-CalendarConnectivity                           ...
</pre>
<p>You can also search based on the &#8220;verb&#8221; of the commands, for example to find all commands that start with the &#8220;Test&#8221; verb:</p>
<pre>
[PS] C:\>Get-Command -Verb "Test"

CommandType     Name                                                Definition
-----------     ----                                                ----------
Function        Test-ActiveSyncConnectivity                         ...
Function        Test-AssistantHealth                                ...
Function        Test-CalendarConnectivity                           ...
Cmdlet          Test-ComputerSecureChannel                          Test-ComputerSecureChannel [-Repair] [-Server <S...
Cmdlet          Test-Connection                                     Test-Connection [-ComputerName] <String[]> [[-So...
Function        Test-EcpConnectivity                                ...
Function        Test-EdgeSynchronization                            ...
Function        Test-ExchangeSearch                                 ...
Function        Test-FederationTrust                                ...
Function        Test-FederationTrustCertificate                     ...
Function        Test-ImapConnectivity                               ...
Function        Test-IPAllowListProvider                            ...
Function        Test-IPBlockListProvider                            ...
Function        Test-IRMConfiguration                               ...
Function        Test-Mailflow                                       ...
Function        Test-MAPIConnectivity                               ...
Cmdlet          Test-ModuleManifest                                 Test-ModuleManifest [-Path] <String> [-Verbose] ...
Function        Test-MRSHealth                                      ...
Function        Test-OrganizationRelationship                       ...
Function        Test-OutlookConnectivity                            ...
Function        Test-OutlookWebServices                             ...
Function        Test-OwaConnectivity                                ...
Cmdlet          Test-Path                                           Test-Path [-Path] <String[]> [-Filter <String>] ...
Function        Test-PopConnectivity                                ...
Function        Test-PowerShellConnectivity                         ...
Function        Test-ReplicationHealth                              ...
Function        Test-SenderId                                       ...
Function        Test-ServiceHealth                                  ...
Function        Test-SmtpConnectivity                               ...
Function        Test-SystemHealth                                   ...
Function        Test-UMConnectivity                                 ...
Function        Test-WebServicesConnectivity                        ...
Cmdlet          Test-WSMan                                          Test-WSMan [[-ComputerName] <String>] [-Authenti...
</pre>
<p>So next time you&#8217;re scratching your head trying to think of the name of that PowerShell command, just give <a href="http://technet.microsoft.com/en-us/library/dd347726.aspx">Get-Command</a> a go.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups" title="PowerShell Script: Check Exchange 2010 Database Backups">PowerShell Script: Check Exchange 2010 Database Backups</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-report-authorized-send-distribution-list" title="Exchange 2010: How to Report Who is Authorized to Send to a Distribution List">Exchange 2010: How to Report Who is Authorized to Send to a Distribution List</a></li><li><a href="http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes" title="How to Modify Settings for Multiple Exchange 2010 Mailboxes">How to Modify Settings for Multiple Exchange 2010 Mailboxes</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/powershell-tip-find-commands">PowerShell Tip: Search for Commands by Keyword</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/powershell-tip-find-commands/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Migrate a Relay Connector from Exchange Server 2007 to 2010</title>
		<link>http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010</link>
		<comments>http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010#comments</comments>
		<pubDate>Sat, 13 Aug 2011 13:09:42 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[Hub Transport]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Relay]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3933</guid>
		<description><![CDATA[How to use the Exchange Management Shell to quickly migrate a relay connector from Exchange 2007 to 2010 with the same remote IP range.]]></description>
			<content:encoded><![CDATA[<p>In most organizations some applications or devices require the ability to <a title="How to Configure a Relay Connector for Exchange Server 2010" href="http://exchangeserverpro.com/how-to-configure-a-relay-connector-for-exchange-server-2010">relay email through Exchange servers</a>.</p>
<p>The source IP addresses of applications and devices that integrate with Exchange using SMTP will need to be added to a Receive Connector that permits relay. Over time this can built up to quite a long list, which creates a tedious task of re-entering all of those IP addresses when you want to migrate this relay connector role, for example during a <a href="http://exchangeserverpro.com/exchange-2007-2010-migration-guide">migration from Exchange 2007 to Exchange 2010</a>.</p>
<p>However if you’d prefer a faster way of doing this you can effectively clone the remote IP address configuration from the existing Receive Connector to the new one by using the <a title="Exchange 2010 FAQ: How Do I Install the Exchange 2010 Management Tools?" href="http://exchangeserverpro.com/exchange-2010-install-management-tools">Exchange Management Shell</a>.</p>
<p>On an<a href="http://exchangeserverpro.com"> Exchange 2010 server</a> launch the Exchange Management Shell.</p>
<p>The first step is to retrieve the list of remote IP addresses from the existing receive connector by running the following command.  This is a single line command, and you should replace the server name and connector name to suit your environment.</p>
<pre>[PS] C:\&gt;$ips = (Get-ReceiveConnector "HO-EX2007-HT1\Relay HO-EX2007-HT1").RemoteIPRanges</pre>
<p>Next run the following command to create the new relay connector on the Exchange 2010 Hub Transport server with the same remote IP range. Again this is a single line command, and you should replace the server name and connector name to suit your environment.</p>
<pre>[PS] C:\&gt;New-ReceiveConnector -Name "Relay HO-EX2010-CAHT1" –Server HO-EX2010-CAHT1” -Usage Custom -AuthMechanism ExternalAuthoritative -PermissionGroups ExchangeServers -Bindings 0.0.0.0:25 -RemoteIPRanges $ips

Identity                                Bindings                           Enabled
--------                                --------                           -------
HO-EX2010-CAHT1\Relay HO-EX2010-CAHT1   {0.0.0.0:25}                       True</pre>
<p>With that simple two step process the new relay connector has been created on the Exchange 2010 Hub Transport server with the same remote IP range as the original one.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/list-users-access-exchange-mailboxes" title="How to List all Users Who Have Access to Other Exchange Mailboxes">How to List all Users Who Have Access to Other Exchange Mailboxes</a></li><li><a href="http://exchangeserverpro.com/clone-mailbox-database-configuration" title="Exchange 2007/2010: How to Clone a Mailbox Database Configuration">Exchange 2007/2010: How to Clone a Mailbox Database Configuration</a></li><li><a href="http://exchangeserverpro.com/exchange-2007-2010-public-folder-store-inconsistent-state" title="Exchange 2007/2010 Public Folder Store in an Inconsistent State">Exchange 2007/2010 Public Folder Store in an Inconsistent State</a></li><li><a href="http://exchangeserverpro.com/powershell-configuring-settings-multiple-exchange-mailbox-databases" title="PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases">PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exchange 2010: How to Report Who is Authorized to Send to a Distribution List</title>
		<link>http://exchangeserverpro.com/exchange-2010-report-authorized-send-distribution-list</link>
		<comments>http://exchangeserverpro.com/exchange-2010-report-authorized-send-distribution-list#comments</comments>
		<pubDate>Thu, 21 Jul 2011 10:50:29 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Distribution Groups]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3792</guid>
		<description><![CDATA[How to use the Exchange Server 2010 management shell to list who can send to restricted distribution groups in the organization.]]></description>
			<content:encoded><![CDATA[<p>In my article about <a href="http://exchangeserverpro.com/restrict-distribution-group-exchange-server-2010">restricting who can send to a distribution list</a> Liz asked this question in the <a href="http://exchangeserverpro.com/restrict-distribution-group-exchange-server-2010#comment-4851">comments</a>:</p>
<blockquote><p>Is there a way to view a list of who is authorized to send to a distribution list once you have restricted it?</p>
<p>We have a good number of distribution lists within our company that are restricted and need a way to report on who is authorized to send without having to scroll and make screen shots every time HR wants to review them.</p></blockquote>
<p><a href="http://exchangeserverpro.com">Exchange 2010</a> makes this easy thanks to the <a title="Exchange 2010 FAQ: How Do I Install the Exchange 2010 Management Tools?" href="http://exchangeserverpro.com/exchange-2010-install-management-tools">Exchange Management Shell</a>. You can use <a href="http://technet.microsoft.com/en-us/library/bb124755.aspx">Get-DistributionGroup</a> to query a group for the message delivery restrictions.</p>
<p>Notice in this example that there are three attributes for AcceptMessagesOnlyFrom&#8230;</p>
<pre>[PS] C:\&gt;Get-DistributionGroup "All Staff" | fl name,accept*

Name                                   : All Staff
AcceptMessagesOnlyFrom                 : {exchangeserverpro.net/Company/Users/Branch Office/Aisha.Bhari}
AcceptMessagesOnlyFromDLMembers        : {}
AcceptMessagesOnlyFromSendersOrMembers : {exchangeserverpro.net/Company/Users/Branch Office/Aisha.Bhari}</pre>
<p>If we look at the same group but this time configured to accept messages from members of a distribution list it looks like this.</p>
<pre>[PS] C:\&gt;Get-DistributionGroup "All Staff" | fl name,accept*

Name                                   : All Staff
AcceptMessagesOnlyFrom                 : {}
AcceptMessagesOnlyFromDLMembers        : {exchangeserverpro.net/Company/Groups/Administration Team}
AcceptMessagesOnlyFromSendersOrMembers : {exchangeserverpro.net/Company/Groups/Administration Team}</pre>
<p>And now again the same group but this time configured to accept messages from both a single user and a distribution list.</p>
<pre>[PS] C:\&gt;Get-DistributionGroup "All Staff" | fl name,accept*

Name                                   : All Staff
AcceptMessagesOnlyFrom                 : {exchangeserverpro.net/Company/Users/Branch Office/Aisha.Bhari}
AcceptMessagesOnlyFromDLMembers        : {exchangeserverpro.net/Company/Groups/Administration Team}
AcceptMessagesOnlyFromSendersOrMembers : {exchangeserverpro.net/Company/Users/Branch Office/Aisha.Bhari, exchangeserver
                                         pro.net/Company/Groups/Administration Team}</pre>
<p>As you can see the <strong>AcceptMessagesOnlyFrom</strong> attribute lists individual authorized senders, and the <strong>AcceptMessagesOnlyFromDLMembers</strong> attribute lists distribution lists that are authorized senders, and then both are shown in the <strong>AcceptMessagesOnlyFromSendersOrMembers</strong> attribute.</p>
<p>So for reporting purposes we can query the <strong>AcceptMessagesOnlyFromSendersOrMembers</strong> attribute.</p>
<pre>[PS] C:\&gt;Get-DistributionGroup "All Staff" | fl name,acceptmessagesonlyfromsendersormembers

Name                                   : All Staff
AcceptMessagesOnlyFromSendersOrMembers : {exchangeserverpro.net/Company/Users/Branch Office/Aisha.Bhari, exchangeserver
                                         pro.net/Company/Groups/Administration Team}</pre>
<p>To list all distribution groups in the organization that are restricted for who can send to them you can run this command.</p>
<pre>[PS] C:\&gt;Get-DistributionGroup | where {$_.AcceptMessagesOnlyFromSendersOrMembers -ne $null} | fl name,acceptmessagesonlyfromsendersormembers

Name                                   : All Staff
AcceptMessagesOnlyFromSendersOrMembers : {exchangeserverpro.net/Company/Users/Branch Office/Aisha.Bhari, exchangeserver
                                         pro.net/Company/Groups/Administration Team}

Name                                   : Executives
AcceptMessagesOnlyFromSendersOrMembers : {exchangeserverpro.net/Company/Groups/Administration Team}</pre>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups" title="PowerShell Script: Check Exchange 2010 Database Backups">PowerShell Script: Check Exchange 2010 Database Backups</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/powershell-tip-find-commands" title="PowerShell Tip: Search for Commands by Keyword">PowerShell Tip: Search for Commands by Keyword</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes" title="How to Modify Settings for Multiple Exchange 2010 Mailboxes">How to Modify Settings for Multiple Exchange 2010 Mailboxes</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/exchange-2010-report-authorized-send-distribution-list">Exchange 2010: How to Report Who is Authorized to Send to a Distribution List</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/exchange-2010-report-authorized-send-distribution-list/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to Modify Settings for Multiple Exchange 2010 Mailboxes</title>
		<link>http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes</link>
		<comments>http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes#comments</comments>
		<pubDate>Wed, 20 Jul 2011 12:58:51 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Console]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3785</guid>
		<description><![CDATA[A look at the Exchange Server 2010 management console and shell and how they can be used to perform bulk administration tasks.]]></description>
			<content:encoded><![CDATA[<p>When you are administering an <a href="http://exchangeserverpro.com">Exchange Server</a> environment one of the things you frequently need to do is change settings for multiple mailboxes that match specific criteria.</p>
<p>For example you may need to find all of the mailbox users in one office location so that you can add them all to a distribution group.</p>
<p>As another example you may need to find all mailbox users in a branch office to make sure that they are blocked from using non-cached mode Outlook.</p>
<p>The <a title="Exchange 2010 FAQ: How Do I Install the Exchange 2010 Management Tools?" href="http://exchangeserverpro.com/exchange-2010-install-management-tools">Exchange Management Console</a> has a filtering feature that lets you create a view of mailbox that match a set of criteria. You can find this in the <strong>Recipient Configuration -&gt; Mailbox</strong> node of the Exchange Management Console.</p>
<p style="text-align: center;"><img class="size-full wp-image-3787 aligncenter" title="filter-01" src="http://exchangeserverpro.com/wp-content/uploads/2011/07/filter-01.jpg" alt="" width="590" height="182" /></p>
<p>Filters can be created based on a pre-set series of attributes, and can also be created with multiple filter criteria.</p>
<p><img class="aligncenter size-full wp-image-3788" title="filter-02" src="http://exchangeserverpro.com/wp-content/uploads/2011/07/filter-02.jpg" alt="" width="590" height="200" /></p>
<p>You can select multiple mailbox users and then open the Properties of those mailboxes to perform bulk edits of some settings.</p>
<p><img class="aligncenter size-full wp-image-3786" title="bulk-edit-01" src="http://exchangeserverpro.com/wp-content/uploads/2011/07/bulk-edit-01.jpg" alt="" width="445" height="232" /></p>
<p>Although these filtered views are useful for some tasks there are also a lot of common administrative tasks that are not available to perform this way.  Also, the Exchange Management Console does not allow you to filter by the complete set of mailbox attributes.</p>
<p>For more advanced Exchange administration you can use the Exchange Management Shell. For example to find the same list of mailboxes shown above you would run this <a href="http://technet.microsoft.com/en-us/library/aa996896.aspx">Get-User</a> command.</p>
<pre>[PS] C:\&gt;Get-User | where {$_.office -eq "Branch Office" -and $_.lastname -like "M*"}

Name                                                        RecipientType
----                                                        -------------
David.Marriott                                              UserMailbox
Dukh.Morgan                                                 UserMailbox
Sharnjit.Mcilroy                                            UserMailbox
Suki.Murray                                                 UserMailbox</pre>
<p>But we can also use the shell to filter our queries on criteria that the management console does not give us access to.  For example to list all mailboxes in the branch office that do not use the database default storage quota you would run this <a href="http://technet.microsoft.com/en-us/library/bb123685.aspx">Get-Mailbox</a> command.</p>
<pre>[PS] C:\&gt;Get-Mailbox | where {$_.office -eq "Branch Office" -and $_.UseDatabaseQuotaDefaults -eq $false}

Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
David.Marriott            David.Marriott       ex2010           unlimited
Dukh.Morgan               Dukh.Morgan          ex2010           unlimited
Kelly.Chatir              Kelly.Chatir         ex2010           unlimited
Neville.Sherwin           Neville.Sherwin      ex2010           unlimited
Sharnjit.Mcilroy          Sharnjit.Mcilroy     ex2010           unlimited
Suki.Murray               Suki.Murray          ex2010           unlimited</pre>
<p>Because the shell gives us so much more flexibility in how we query Exchange it makes it a more powerful tool for performing bulk edits.</p>
<p>Taking the examples from the start of this article here is how you can achieve those outcomes.</p>
<p>The first example is adding all users in a particular office to a distribution group. We know that we can query Exchange for all users in “Head Office” with this command:</p>
<pre>[PS] C:\&gt;Get-Mailbox | where {$_.office -eq "Head Office"}</pre>
<p>So here is how I would add them all to the “Head Office Staff” distribution group that already exists.</p>
<pre>[PS] C:\&gt;$headofficeusers = Get-Mailbox | where {$_.office -eq "Head Office"}

[PS] C:\&gt;$headofficeusers.count
367

[PS] C:\&gt;$headofficeusers | Add-DistributionGroupMember -Identity "Head Office Staff"</pre>
<p>I can then quickly check the outcome.</p>
<pre>[PS] C:\&gt;$members = Get-DistributionGroupMember -Identity "Head Office Staff"

[PS] C:\&gt;$members.Count
367</pre>
<p>The second example is configuring branch office users to be <a href="http://exchangeserverpro.com/exchange-2010-block-non-cached-mode-outlook">blocked from connecting with non-cached mode Outlook</a> clients. Here is how I would perform that task.</p>
<pre>[PS] C:\&gt;$branchusers = Get-Mailbox | where {$_.office -eq "Branch Office"}

[PS] C:\&gt;$branchusers.Count
20</pre>
<p>I want to filter them further down to only the users not currently blocked from using non-cached mode.</p>
<pre>[PS] C:\&gt;$branchusers = $branchusers | Get-CASMailbox | where {$_.MAPIBlockOutlookNonCachedMode -eq $false}

[PS] C:\&gt;$branchusers.Count
19</pre>
<p>Now to perform the bulk edit to disable non-cached mode Outlook for the 19 branch office users who are currently not blocked.</p>
<pre>[PS] C:\&gt;$branchusers | Set-CASMailbox -MAPIBlockOutlookNonCachedMode $true</pre>
<p>As you can see the Exchange Management Shell is a very powerful tool for Exchange administrators especially when performing bulk administration tasks.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups" title="PowerShell Script: Check Exchange 2010 Database Backups">PowerShell Script: Check Exchange 2010 Database Backups</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/powershell-tip-find-commands" title="PowerShell Tip: Search for Commands by Keyword">PowerShell Tip: Search for Commands by Keyword</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-report-authorized-send-distribution-list" title="Exchange 2010: How to Report Who is Authorized to Send to a Distribution List">Exchange 2010: How to Report Who is Authorized to Send to a Distribution List</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes">How to Modify Settings for Multiple Exchange 2010 Mailboxes</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Calculate Exchange 2010 Mailbox Sizes with PowerShell</title>
		<link>http://exchangeserverpro.com/calculate-exchange-2010-mailbox-sizes-powershell</link>
		<comments>http://exchangeserverpro.com/calculate-exchange-2010-mailbox-sizes-powershell#comments</comments>
		<pubDate>Wed, 06 Jul 2011 11:00:09 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[Mailboxes]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=2664</guid>
		<description><![CDATA[How to use the Exchange Server 2010 Management Shell to calculate the size of multiple mailboxes.]]></description>
			<content:encoded><![CDATA[<p>The <a title="Exchange 2010 FAQ: How Do I Install the Exchange 2010 Management Tools?" href="http://exchangeserverpro.com/exchange-2010-install-management-tools">Exchange Management Shell</a>, powered by PowerShell, makes it easy to collect size information for the mailboxes in an <a href="http://exchangeserverpro.com">Exchange 2010</a> organization.</p>
<p>For example, to list the sizes of all mailboxes on a particular database we can use this command.</p>
<pre>[PS] C:\&gt;Get-Mailbox -Database MB-HO-01 | Get-MailboxStatistics | ft displayname,totaldeleteditemsize,totalitemsize

DisplayName      TotalDeletedItemSize    TotalItemSize
-----------      --------------------    -------------
Administrator    0 B (0 bytes)           85.42 KB (87,468 bytes)
Alan Reid        80.08 KB (82,000 bytes) 30.9 MB (32,400,667 bytes)
Alex Heyne       12.35 KB (12,644 bytes) 8.734 MB (9,158,159 bytes)
Aisha Bhari      0 B (0 bytes)           190.4 KB (194,983 bytes)
Aleisha Harrison 0 B (0 bytes)           142.4 KB (145,797 bytes)</pre>
<p>If we wanted to know the total size of all of those mailboxes we could output the data to CSV file, import it into Excel, and use formulas to get the results.  However that is time-consuming if all you are after is a quick answer.</p>
<p>So instead we can use the <a href="http://technet.microsoft.com/en-us/library/ee176900.aspx">Measure-Object</a> command in PowerShell to get the answers we&#8217;re looking for. However if we try to use it with the data shown above we&#8217;ll get this error.</p>
<pre>Measure-Object : Input object "79.95 KB (81,870 bytes)" is not numeric.</pre>
<p>So first we need to convert the data into numeric form.</p>
<p>For example, to see the sum, average, minimum and maximum size of the &#8220;total item size&#8221; for the mailboxes above we run this command.</p>
<pre>[PS] C:\&gt;Get-Mailbox -Database MB-HO-01 | Get-MailboxStatistics | %{$_.TotalItemSize.Value.ToMB()} | Measure-Object -sum
 -average -max -min

Count    : 5
Average  : 7.6
Sum      : 38
Maximum  : 30
Minimum  : 0
Property :</pre>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups" title="PowerShell Script: Check Exchange 2010 Database Backups">PowerShell Script: Check Exchange 2010 Database Backups</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/powershell-script-create-mailbox-size-report-exchange-server-2010" title="PowerShell Script to Create a Mailbox Size Report for Exchange Server 2010">PowerShell Script to Create a Mailbox Size Report for Exchange Server 2010</a></li><li><a href="http://exchangeserverpro.com/powershell-tip-find-commands" title="PowerShell Tip: Search for Commands by Keyword">PowerShell Tip: Search for Commands by Keyword</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/calculate-exchange-2010-mailbox-sizes-powershell">How to Calculate Exchange 2010 Mailbox Sizes with PowerShell</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/calculate-exchange-2010-mailbox-sizes-powershell/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to List all Users Who Have Access to Other Exchange Mailboxes</title>
		<link>http://exchangeserverpro.com/list-users-access-exchange-mailboxes</link>
		<comments>http://exchangeserverpro.com/list-users-access-exchange-mailboxes#comments</comments>
		<pubDate>Sat, 02 Jul 2011 11:27:59 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3712</guid>
		<description><![CDATA[This PowerShell command will export to CSV a list of any Exchange mailboxes where other users have permissions to access them.]]></description>
			<content:encoded><![CDATA[<p>While preparing for an <a href="http://exchangeserverpro.com/exchange-2007-2010-migration-guide">Exchange Server 2007 to 2010 migration</a> I needed to work out which users had been granted access to other mailboxes. This applied both to shared mailboxes (eg a Help Desk) and individual mailbox access (eg a personal assistant with access to the CEO&#8217;s mailbox).</p>
<p>Exchange 2007/2010 provide the <a href="http://technet.microsoft.com/en-us/library/aa998218.aspx">Get-MailboxPermission</a> cmdlet that can be used to query the permissions on a mailbox. For example:</p>
<pre>Get-MailboxPermission helpdesk

Identity             User                 AccessRights        IsInherited Deny
--------             ----                 ------------        ----------- ----
exchangeserverpro... NT AUTHORITY\SELF    {FullAccess, Rea... False       False
exchangeserverpro... ESPNET\Alex.Heyne    {FullAccess}        False       False
exchangeserverpro... ESPNET\Debbie.Lisa   {FullAccess}        False       False
exchangeserverpro... ESPNET\Kevin.Douglas {FullAccess}        False       False</pre>
<p>To get the same information about all of the mailboxes in the environment we could run this command.</p>
<pre>Get-Mailbox | Get-MailboxPermission

Identity             User                 AccessRights        IsInherited Deny
--------             ----                 ------------        ----------- ----
exchangeserverpro... NT AUTHORITY\SELF    {FullAccess, Rea... False       False
exchangeserverpro... ESPNET\BR-EX2007-MB$ {ReadPermission}    True        False
exchangeserverpro... ESPNET\Exchange S... {FullAccess}        True        True
exchangeserverpro... ESPNET\Domain Admins {FullAccess}        True        True
exchangeserverpro... ESPNET\Enterprise... {FullAccess}        True        True
exchangeserverpro... ESPNET\Exchange O... {FullAccess}        True        True
exchangeserverpro... ESPNET\administrator {FullAccess}        True        True
exchangeserverpro... ESPNET\Exchange S... {FullAccess}        True        False
exchangeserverpro... ESPNET\Exchange P... {ReadPermission}    True        False
exchangeserverpro... NT AUTHORITY\NETW... {ReadPermission}    True        False
exchangeserverpro... ESPNET\Exchange S... {ReadPermission}    True        False
exchangeserverpro... ESPNET\Exchange V... {ReadPermission}    True        False
exchangeserverpro... ESPNET\Exchange O... {FullAccess, Del... True        False
exchangeserverpro... ESPNET\administrator {FullAccess, Del... True        False
exchangeserverpro... ESPNET\Enterprise... {FullAccess, Del... True        False
exchangeserverpro... ESPNET\Domain Admins {FullAccess, Del... True        False
.....</pre>
<p>The problem with that is it gives us more information than we really need, with a lot of SELF permissions and inherited permissions that aren&#8217;t relevant to the task we&#8217;re trying to accomplish.</p>
<p>You could export the output to CSV and manipulate it using Excel to get just the permissions information you want, but another method is to filter the PowerShell output.</p>
<p>For example, to filter out all of the SELF permissions and the inherited permissions we can run this command.</p>
<pre>Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}</pre>
<p>That gives us a much smaller output that is more useful.</p>
<pre>Identity             User                 AccessRights        IsInherited Deny
--------             ----                 ------------        ----------- ----
exchangeserverpro... ESPNET\Alannah.Shaw  {FullAccess}        False       False
exchangeserverpro... ESPNET\Payroll Team  {FullAccess}        False       False
exchangeserverpro... ESPNET\Alex.Heyne    {FullAccess}        False       False
exchangeserverpro... ESPNET\Debbie.Lisa   {FullAccess}        False       False
exchangeserverpro... ESPNET\Kevin.Douglas {FullAccess}        False       False</pre>
<p>The Identity field contains long strings because it includes the full directory path to the mailbox user, so it may get truncated on your screen. In that case you could export the output to CSV file.</p>
<pre>Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Export-Csv -NoTypeInformation mailboxpermissions.csv</pre>
<p>The trouble you may notice with that is that the access rights do not appear correctly in the output CSV file.</p>
<pre>AccessRights,Deny,InheritanceType,User,Identity,IsInherited,IsValid,ObjectState
Microsoft.Exchange.Management.RecipientTasks.MailboxRights[],False,All,ESPNET\Alannah.Shaw,"exchangeserverpro.net/Company/Head Office/Users/Mark.Patel",False,True,Unchanged
Microsoft.Exchange.Management.RecipientTasks.MailboxRights[],False,All,"ESPNET\Payroll Team","exchangeserverpro.net/Company/Head Office/Users/Payroll",False,True,Unchanged
Microsoft.Exchange.Management.RecipientTasks.MailboxRights[],False,All,ESPNET\Alex.Heyne,"exchangeserverpro.net/Users/Help Desk",False,True,Unchanged
Microsoft.Exchange.Management.RecipientTasks.MailboxRights[],False,All,ESPNET\Debbie.Lisa,"exchangeserverpro.net/Users/Help Desk",False,True,Unchanged
Microsoft.Exchange.Management.RecipientTasks.MailboxRights[],False,All,ESPNET\Kevin.Douglas,"exchangeserverpro.net/Users/Help Desk",False,True,Unchanged</pre>
<p>So to fix that we need to use a slightly different command. This single-line command will export to CSV a list of any mailboxes where other users have permissions to access them, and will also list what level of access those users have.</p>
<pre>Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,@{Name='Access Rights';Expression={[string]::join(', ', $_.AccessRights)}} | Export-Csv -NoTypeInformation mailboxpermissions.csv</pre>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-mailbox-database-backup-time" title="PowerShell Script: Check Exchange Mailbox Database Last Backup Time">PowerShell Script: Check Exchange Mailbox Database Last Backup Time</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/clone-mailbox-database-configuration" title="Exchange 2007/2010: How to Clone a Mailbox Database Configuration">Exchange 2007/2010: How to Clone a Mailbox Database Configuration</a></li><li><a href="http://exchangeserverpro.com/exchange-2007-2010-public-folder-store-inconsistent-state" title="Exchange 2007/2010 Public Folder Store in an Inconsistent State">Exchange 2007/2010 Public Folder Store in an Inconsistent State</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/list-users-access-exchange-mailboxes">How to List all Users Who Have Access to Other Exchange Mailboxes</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/list-users-access-exchange-mailboxes/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Exchange 2007/2010: How to Clone a Mailbox Database Configuration</title>
		<link>http://exchangeserverpro.com/clone-mailbox-database-configuration</link>
		<comments>http://exchangeserverpro.com/clone-mailbox-database-configuration#comments</comments>
		<pubDate>Fri, 17 Jun 2011 13:26:43 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Management Shell]]></category>
		<category><![CDATA[Mailbox Server]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=3656</guid>
		<description><![CDATA[Here is an Exchange Management Shell technique you can use to clone the settings from one mailbox database to another, or to a whole mailbox server.]]></description>
			<content:encoded><![CDATA[<p>I was setting up a new <a href="http://exchangeserverpro.com">Exchange Server 2007</a> cluster today and decided to share this technique I use to save time configuring the mailbox databases.</p>
<p>Since the clusters we build tend to have a lot of storage groups and databases on them (25 for the one I worked on today) some automation really speeds things up.</p>
<p>Firstly I always use a <a href="http://exchangeserverpro.com/ems-script-your-exchange-server-2007-storage-groups-and-mailbox-databases">script to create the storage groups and mailbox databases</a>. This is pretty easy, especially when you have naming standards that let you do a find/replace on the script as you use it from server to server.</p>
<p>The cmdlets for these operations are <a href="http://technet.microsoft.com/en-us/library/bb124941(EXCHG.80).aspx">New-StorageGroup</a> and <a href="http://technet.microsoft.com/en-us/library/aa997976(EXCHG.80).aspx">New-MailboxDatabase</a>. You&#8217;ll find a very old sample script of mine <a href="http://exchangeserverpro.com/ems-script-your-exchange-server-2007-storage-groups-and-mailbox-databases">here</a> that demonstrates how they can be scripted.</p>
<p>Secondly I use a few shell commands to clone the database configuration from an existing mailbox database. By that I mean settings such as the mailbox retention, deleted items retention, storage quotas, offline address book, and public folders.  These are settings that we typically keep the same across all the Exchange clusters.</p>
<p>First I collect the settings from an existing mailbox database into an array.</p>
<pre>$a = Get-MailboxDatabase  [name of database to clone]</pre>
<p>The various settings can then be referenced in the array, such as $a.PublicFolderDatabase.</p>
<p>Once I&#8217;ve done that there are two ways to apply it to other mailbox databases. I can apply it to a single database like this.</p>
<pre>Set-MailboxDatabase [new mailbox database name] -OfflineAddressBook $a.OfflineAddressBook -PublicFolderDatabase $a.PublicFolderDatabase -IssueWarningQuota $a.IssueWarningQuota -ProhibitSendQuota $a.ProhibitSendQuota -ProhibitSendReceiveQuota $a.ProhibitSendReceiveQuota -MailboxRetention $a.MailboxRetention -DeletedItemRetention $a.DeletedItemRetention</pre>
<p>Or, as I did today, I can apply it to all of the mailbox databases on a given server.</p>
<pre>Get-MailboxDatabase -server [new server name] | Set-MailboxDatabase -OfflineAddressBook $a.OfflineAddressBook -PublicFolderDatabase $a.PublicFolderDatabase -IssueWarningQuota $a.IssueWarningQuota -ProhibitSendQuota $a.ProhibitSendQuota -ProhibitSendReceiveQuota $a.ProhibitSendReceiveQuota -MailboxRetention $a.MailboxRetention -DeletedItemRetention $a.DeletedItemRetention</pre>
<p>As you can see the <a title="Exchange 2010 FAQ: How Do I Install the Exchange 2010 Management Tools?" href="http://exchangeserverpro.com/exchange-2010-install-management-tools">Exchange Management Shell</a> really does make it easy to administer Exchange 2007 and 2010 environments.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-mailbox-database-backup-time" title="PowerShell Script: Check Exchange Mailbox Database Last Backup Time">PowerShell Script: Check Exchange Mailbox Database Last Backup Time</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-test-servicehealth" title="Using Test-ServiceHealth for Exchange Server Health Checks">Using Test-ServiceHealth for Exchange Server Health Checks</a></li><li><a href="http://exchangeserverpro.com/migrate-relay-connector-exchange-server-2007-2010" title="How to Migrate a Relay Connector from Exchange Server 2007 to 2010">How to Migrate a Relay Connector from Exchange Server 2007 to 2010</a></li><li><a href="http://exchangeserverpro.com/list-users-access-exchange-mailboxes" title="How to List all Users Who Have Access to Other Exchange Mailboxes">How to List all Users Who Have Access to Other Exchange Mailboxes</a></li><li><a href="http://exchangeserverpro.com/move-exchange-2007-storage-group-database-paths" title="How to Move Storage Group and Database File Paths in Exchange Server 2007">How to Move Storage Group and Database File Paths in Exchange Server 2007</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/clone-mailbox-database-configuration">Exchange 2007/2010: How to Clone a Mailbox Database Configuration</a> is © 2011 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/clone-mailbox-database-configuration/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

