[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


Export mailboxes to PST one by one in Exchange2007 and 2010

Published on
11,509 Points
7 Endorsements
Last Modified:
Exchange Server, Windows Server, Active Directory, Virtualization, Skype for Business Expert.
Export mailboxes to PST in bulk
Most of the administrators run bulk export of mailboxes to PST using the command 
foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\UNCPATH\$($i.Alias).pst"}

Open in new window

If your server resources not sufficient to do the export your server may restart automatically. As a workaround below mentioned commands will help you to export to PST without exchange server service restart/outage by doing a mailbox export one by one.
Export mailboxes one by one to same folder
This command will check every 3 minutes that current export request is completed or no.  You can change the value based on your mailbox sizes.
It will export to \\Backupserver\PSTs as PSTs with alias as the file name. Example a user with alias jsmith it will be exported to \\Backupserver\PSTs as jsmith.pst
Below command  will export one mailbox at a time. It will check every 3 minutes 

foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\Backupserver\PSTs\$($i.Alias).pst" -baditemlimit 50 -acceptlargedataloss ;while ((Get-MailboxExportRequest -mailbox $i | ? {$_.Status -eq “Queued” -or $_.Status -eq “InProgress”})) { sleep 180 } }

Open in new window

Export malboxes one by one to different folders
If you want to export to multiple folders. For example if you  have 3 users with these alias jsmith, Joe and James. You can export to same as below. 
Below command  will export one mailbox at a time and will export to the corresponding folders.
foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\Backupserver\PSTs\$($i.Alias)\$($i.Alias).pst" -baditemlimit 50 -acceptlargedataloss ;while ((Get-MailboxExportRequest -mailbox $i | ? {$_.Status -eq “Queued” -or $_.Status -eq “InProgress”})) { sleep 180 } }

Open in new window

Hope it helps.
  • 5
LVL 31

Author Comment

LVL 31

Author Comment

Hi Ericpete,
The article in socialTechnet is published by me. You can check who published it.
I am more interested in EE than Social Technet. What ever I publish in Social Technet I will have a copy here and vice-versa.
This is another example.TechnetWiki  EE
 You can compare my contributions in EE and in Social Technet. Contributions in EE much much more compare to SocialTechnet.

Regarding number of words. I will rewrite and let you know.
LVL 31

Author Comment

It is already enabled.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.


Expert Comment

by:Akash Bansal
How to bookmark this
LVL 31

Author Comment

Are you talking about bookmarking in your PC ?
If yes please check these

if you want to add to bookmark in your profile in Experts-Exchange database please click "Add to Personal Knowledgebase"
LVL 10

Expert Comment

by:Senior IT System Engineer

Must the PowerShell script be executed on the server with Outlook installed or it can be executed on the Laptop with PowerShell remoting running?

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://ExchangeServer/Powershell/ -Authentication Kerberos
Import-PSSession $Session

Open in new window

LVL 31

Author Comment

@Senior IT System Engineer
From Exchange2010 onwards Outlook binaries are included in server.

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Join & Write a Comment

This video discusses moving either the default database or any database to a new volume.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month