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.


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’) }


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 is a Canadian Exchange Server MVP and MCSM (Solutions Master) and he contributes to the Microsoft Community with articles, tutorials, blog posts, forums and book reviews. He is a regular contributor at MSExchange.org, ITPROCentral.com and AndersonPatricio.org (Portuguese).