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

Rollup Update for Exchange Server 2007/2010 and Se... Exchange Team has just released Rollup Updates for Exchange Server 2007/2010 and Security Updates for Exchange Server 2013. Update Rollup 2 For Exch...
How to Export Recoverable Deleted Items and Purges... Hi there folks! In some situation during regular operations an user deletes something and the Operations/Exchange Admin has to work on the issue to r...
How to… access EAC after installing the first Exch... As soon as you introduce your first Exchange Server 2013 in your organization you first action may be trying to logon on ECP/EAC to get access however...
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...