Exporting PSTs based on Organization Unit

Share this:

In some scenarios the administrator may want to export all mailboxes of a specific OU to PST. Using Exchange Server 2013/2016 this can be accomplished with a single PowerShell line.

Solution


The cmdlet to export mailbox content to PSTs is the New-MailboxExportRequest and using it in combination with Get-Mailbox –organizationalUnit cmdlet allows the administrator to group several users in a single line and then start exporting the content to PST files.

The tricky part is during the export process, where we use the information coming from the previous cmdlet (get-mailbox) and create a PST for each mailbox using its alias.

Get-Mailbox –OrganizationalUnit domain.ca/OUName | foreach { New-MailboxExportRequest -Mailbox $_.Alias -FilePath (‘\\server\share\’ + ($_.alias) + ‘.pst’) }

image

The administrator can use several other filters built-in on Get-Mailbox to export to a PST. A good example is to replace the –OrganizationalUnit for –Database and by doing that all mailboxes from any given database can be exported to a PST.

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Related Post

How to.. generate a list of all ActiveSync devices... In Today’s post we are going over a simple cmdlet to generate a list of all ActiveSync devices that you have in your organization For starters, we ca...
Getting Exchange Server numbers with PowerShell In this Tutorial we are going over a few cmdlets to get the number of Exchange Server in your Exchange Organization. Solution I’m often asked ...
How to remove the several Organization Units that ... In some situation an entire structure of Organization Units must be deleted, and by default new OUs are automatic defined to protect them against dele...
How to … Renew Certificates in Exchange Server 201... In Today’s post we are going over the process to renew a Certificate in Exchange Server 2010. For this blog post I’m going to use Digicert and you ca...