About This Site

I'm a Tech Guy for over 30 Years Knowledge of Computers, Networks, PC Gadgets. This site is to be used to share some of my knowledge and reviews

Export From MS Exchange to PST

Working with an Exchange 2010 Server and you want to export mailboxes to PST files. First you have to make sure you are running MS Exchange 2010 with SP1 or greater. Once SP1 or greater is installed then you need to give the administrator (or whoever will be logged in and running the script file) permission to run the commands.

Open MS Exchange Shell and run the following on the user:

New-Managementroleassignment –Role “Mailbox Import Export” –User “Administrator”

Now for the commands to work you need to exit the shell and then start it again.

In order to export you need to create a share on the server (or other PC if you like) so the export can go to the share. Example I created a share on the server called PST so the path would be \\Server\PST.

Now to do a Bulk export there are a few ways of doing it. The first way uses a .txt file that contains all the aliases of the mailboxes you want to export.If you create the .txt file in a folder called C:\PST\Aliases.txt.

You can then create a script and save it as a .ps1 file.

$content = get-content “C:\PST\Aliases.txt”

foreach ($user in $content)
{

New-MailboxExportRequest -Mailbox $user -FilePath “\\SERVER\PST\$user Mailbox.pst”
}

Now you just need to run the .ps1 file in the shell. Example

.\ExportPST.ps1

A command to create the Aliases.txt file could be following. Make sure you are in the folder where the Aliases.txt will be:

get-mailbox | select -expand alias >Aliases.txt

Then just edit the Aliases.txt file to remove any unwanted mailboxes.

If you want to schedule this to happen follow this page Schedule Exchange PowerShell

Another way is to open Exchange Management Shell and type the following 2 command:

$Export = Get-Mailbox

$Export|%{$_|New-MailboxExportRequest -FilePath “file://servername/pst/$($_.alias).pst“}

I got this info from the following posts:

Post 1

Post 2

If the export does not work it could be the export got stuck (Could happen if server restarts for a Windows update while its still exporting to PST).

If you run this is Exchange Shell and specify A for Yes to All it will stop any broken export commands. Hopefully the next time you export it will work:

Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest

Comments are closed.