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

Retrieving ActiveSync Logs: Using Outlook Web App Good morning my friends (long time no see, after a couple of days in holidays I’m back!) In Today’s post we are going to check it out the ActiveSync ...
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 ...
Upgrading AD Schema for Exchange Server 2010 SP3 m... Hello folks (Are you guys ready for MMS? I’m on my way!) Now that we have the Exchange Server 2013 CU1 the Service Pack 2010 Service Pack 3 became ev...
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...