Exchange Server 2010 mass export mailboxes to pst file

This post is also available in: Polish

Last time we wrote how to export mailbox from Exchange 2010 to pst file and import items from pst file to Exchange 2010 mailbox.

Exchange 2010 export import mailboxes

Now we will explain how to export few mailboxes at once from Exchange 2010.

When you want to export few mailboxes at once to .pst files you have to get aliases of those mailboxes and then run New-MailboxExportRequest in ForEach loop.

Below we present few examples how to export mailboxes with specified conditions:

To export mailboxes from specified mailbox database use:

ForEach ($mbx in (Get-Mailbox -Database DatabaseName)) {
 New-MailboxExportRequest -Mailbox $mbx -FilePath "\\server\share_pst\${$mbx.Alias).pst" 
}

To export mailboxes from specified OU:

ForEach ($mbx in (Get-Mailbox -OrganizationalUnit "DisabledUsers")) {
New-MailboxExportRequest -Mailbox $mbx -FilePath "\\server\share_pst\$($mbx.Alias).pst" 
}

 

To export mailboxes listed in .csv file you need to create .csv file with mailbox aliases and column name Alias, one alias per one row and then run:

foreach ($mbx in (Import-Csv "d:\scripts\mbx_aliases.csv)) { 
New-MailboxExportRequest -Mailbox $mbx.Alias -FilePath "\\server\share_pst\$($mbx.Alias).pst" 
}

 

As you can see, mailboxes mass export to .pst files is quite simple.

 

Print Friendly
Tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>