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

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 ...
Exchange 2013 Security Update MS13-061 Status Upda... MSExchangeTeam released a status update about the new Security Update where customers running Exchange Server 2013 are facing issues. Late last night...
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...
PowerShell Script to fix Exchange Server 2013 Secu... I wrote the following PowerShell script to help fixing the issue reported by Microsoft Exchange Team (http://blogs.technet.com/b/exchange/archive/2013...