How to Export (bulk export) Mailboxes to PST, Exchange Server 2010 Print E-mail

Written by Praveen   
Wednesday, 11 April 2012 12:50

I have been seeing few questions about the mailbox PST export activity on Exchange Server 2010 in forums. In this post, I tried to pen down few helpful command combination of New-MailboxExportRequest in Exchange Server 2010.

Let’s first look at how simply you can export single mailbox PST, followed with some easier filtering option to bulk PST export.

Note – before you proceed, ensure that you have added the PSTAdmin (or any other user, it can be the Exchange Admin also) user to the “Mailbox Import Export

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User PSTAdmin

After this, you will have to re-open the Management Shell to execute the New-MailboxExportRequest successfully.

Also create a network share with read/write permission to this user, it can be create on the server where you run the command. We will use this path for storing the exported PSTs.

Exporting single Mailbox and Archive from Exchange Server 2010,

New-MailboxExportRequest -Mailbox Praveen.Balan -FilePath \\ED-Ex2010\pst\ Praveen.Balan.pst

It looks so simple right, now will it export the personal Archive mailbox as well? The answer is ‘NO’, but if you like to export archive mailbox also, just add –IsArchive parameter at the end of the cmdlet.

New-MailboxExportRequest -Mailbox Praveen.Balan -FilePath \\ED-Ex2010\pst\ArchPraveen.Balan.pst –IsArchive

Exporting Bulk users PST using New-MailboxExportRequest

In many scenarios, we will reach situation where we want to export PST of groups of mailboxes. How do we approach, I have shown couple of such scenario and further can be explored by yourself.

Export PST of mailboxes in a single DATABASE

foreach ($i in (Get-Mailbox -ResultSize Unlimited|Where {$_.Database -eq "Profile-01"})) { New-MailboxExportRequest -Mailbox $i -FilePath "\\ED-Ex2010\pst \$($i.Alias).pst" }

In the cmdlet above ‘Get-Mailbox -ResultSize Unlimited|Where {$_.Database -eq "Profile-01"}’ plays the filtering role, it verify the database parameter of each mailbox in your organization and pass it to the New-MailboxExportRequest cmdlet as input. So if you encounter any issue, please ensure that the filter gives necessary output (run the filter alone in EM Shell).

Export PST of all users

It is farely simple, not much of filtering,

foreach ($i in (Get-Mailbox -ResultSize Unlimited)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\ED-Ex2010\pst \$($i.Alias).pst" }

In the above cmdlet, the filter Get-Mailbox -ResultSize Unlimited will retrieve all mailboxes in your organization.Now you must be think why the "-ResultSize Unlimited", If you have less than 1000 users on your infrastrucuture then you dont need specify the limit. By default the Get commands searches for first 1000 entries. To over come that we add the -ResultSize Unlimited paramater into all commands.

If you want to export Archive mailbox, add the additional parameter (switch) as mentioned earlier. As like above, you can try your own filter for exporting the PST of mailboxes. All you need to do create filtering criteria as I did above and replace it in the shell cmdlet.

Are we done? , few cleanup jobs are pending. When you run the export request it will go for queue and start the export activity. You can verify the status by running the below command,


If you find all the request status are ‘completed’, you are good to execute the Remove-MailboxExportRequest cmdlet. You can still remove the mailbox request which are completed using the below cmdlet,

Get-MailboxExportRequest | where {$_.status -eq "Completed"} | Remove-MailboxExportRequest

It looks difficult; I think it is really easy. You will get familiar with it once you execute it for couple of times…

Still you end up in issues/errors?, please comment I will help you…


AddThis Social Bookmark Button
Last Updated on Thursday, 12 April 2012 00:12


0 # TnT 2012-04-15 05:48
I am trying to bulk export many mailboxes at once. I am using the Get-Content command to get all aliases in a simple csv file (no headers).

Get-Content C:\Scripts\Exch ange2012Migration\c.csv | foreach-object {New-MailboxExportRe quest -Mailbox $_ -FilePath "\\server\t$\Exc hange\$_.full.pst"}

However, I am noticing if I try to run this against a file with over 20 names in it (approximately anyway), I find my mailbox export requests fail. I'd love to know your thoughts on what I could do.
Reply | Reply with quote | Quote
0 # Praveen 2012-04-15 10:27
Try with this,
Import-CSV C:\input.csv | foreach-object {New-MailboxExportRe quest -Mailbox $_.Alias -FilePath "\\ex2010-01\Exports\$($_.Alias).pst"}

Where you give the required mailbox aliases as input file, ensure that the column heading is "Alias". It worked...
Reply | Reply with quote | Quote
0 # shai 2012-12-24 19:03
Thank you very much :)
Reply | Reply with quote | Quote
0 # Maddas69 2012-06-20 03:13
Regarding the export of All Users command: How can you limit how many mailboxes is exportet simultanously? I have a server with 4 mailbox databases and there is just too many "In progress" jobs (15 of them while the rest i queuing) running at the same time, effectively consuming all the memory of the server.
Reply | Reply with quote | Quote
0 # _Praveen 2012-06-20 09:59

The default per DB is 5, I think since you have 4 DBs it can reach upto 20 as well.. To control it, you may try modifying the MSExchangeMailb oxReplication.exe.config file located in Bin directory. Look at the MS article here,
Reply | Reply with quote | Quote
0 # _Praveen 2012-06-20 10:01
Rather doing some changes to config file, I would suggest you to initiate the export per DB basis. That will help in reducing the number of tasks to 5 at any point in time.
Reply | Reply with quote | Quote
0 # Maddas69 2012-06-21 22:10
Thank you for your tip. I ended up doing the mailboxes manually (two and two) because of poor performance on the server.
Reply | Reply with quote | Quote
0 # Derek Lee 2012-09-08 00:24
Does anyone know a script to bulk export mailboxes, but to limit the size of the exported .pst file to 2gb for each mailbox? For example, if you have a user that has a 3gb mailbox, when you run the command, it will only create an exported .pst with only 2gb of data and not the full 3gb.
Reply | Reply with quote | Quote
0 # Hans Jakob 2012-11-16 15:29
Thanks for the great 'article'. However, when my export archive jobs are completed, I remove the mailboxrequests , I can not see the .pst-files anywhere? The command I'm using is: New-MailboxExportRe quest -Mailbox 'user' -IsArchive -FilePath \\SERVER\softwa re\hja_Archive.pst - Any ideas?
Reply | Reply with quote | Quote
0 # helper 2012-11-20 14:17
the last command will not work unattended without -Confirm:$False ie Get-MailboxExportRe quest | where {$_.status -eq "Completed"} | Remove-MailboxExportRe quest -Confirm:$False
Reply | Reply with quote | Quote
0 # james 2013-04-17 00:23
Know a way to export users inbox custom rules/filters as well the pst does not seem to be exporting those...
Reply | Reply with quote | Quote
0 # Roland 2013-04-30 00:05
Is it possible to use the primary SMTP Adress instead of the alias? I'm working on a script for hosted Exchange and we have the 'office' alias in more than one organisation.
Reply | Reply with quote | Quote
0 # Leandro 2013-05-03 02:49
Reply | Reply with quote | Quote
0 # Joe 2013-06-15 01:49
I have manually exported 5 mailboxes as a test. The mailbox size varied from 300 MB to 2 GB in size, yet all the .pst when created have a length of 1.67 GB? Is there a reason that all the .pst files are the same size, and what happens if I export a 5 GB mailbox, do I lose data?
Reply | Reply with quote | Quote
0 # _Praveen 2013-06-16 09:22
The export cmdlet used here is same as single mailbox export, hence it should not create an issue. And there will not be any data lose.
Reply | Reply with quote | Quote
0 # Tom 2014-02-17 21:16
How to apply filter if I want to export all mailboxes to pst for only the emails received during the last month
Reply | Reply with quote | Quote

Add comment

Security code

Read In




Online : 17
Your IP:

Follow Us