Export mailboxes to PST one by one in Exchange2007 and 2010

M A SService Manager
CERTIFIED EXPERT
Most Valuable Expert2017 and 2020.
O365, Exchange Server,Windows Server, Active Directory, Virtualization, Teams and Email Migration Expert.
Published:
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. 
\\Backupserver\PSTs\jsmith\jsmith.pst
\\Backupserver\PSTs\joe\Joe.pst
\\Backupserver\PSTs\james\james.pst
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.
7
3,368 Views
M A SService Manager
CERTIFIED EXPERT
Most Valuable Expert2017 and 2020.
O365, Exchange Server,Windows Server, Active Directory, Virtualization, Teams and Email Migration Expert.

Comments (7)

M A SService Manager
CERTIFIED EXPERT
Most Valuable Expert 2020
Most Valuable Expert 2017

Author

Commented:
It is already enabled.
Akash BansalIT Professional

Commented:
How to bookmark this
M A SService Manager
CERTIFIED EXPERT
Most Valuable Expert 2020
Most Valuable Expert 2017

Author

Commented:
Are you talking about bookmarking in your PC ?
If yes please check these
http://windows.microsoft.com/en-us/internet-explorer/add-view-organize-favorites#ie=ie-10
http://www.computerhope.com/issues/ch000858.htm

if you want to add to bookmark in your profile in Experts-Exchange database please click "Add to Personal Knowledgebase"
Albert WidjajaSecurity Engineer
CERTIFIED EXPERT

Commented:
Hi MAS,

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

M A SService Manager
CERTIFIED EXPERT
Most Valuable Expert 2020
Most Valuable Expert 2017

Author

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

View More

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.