Command line mailbox import and export with exchange

The more recent MS Exchange versions support importing an dexporting of mailboxes directly to and from PST files on your server. This method uses the same technology stack Outlook uses, which means at the time of writing a mailbox size limit of 20GB. If you have more data in a single mailbox you will need to either manualy split and export to multiple PST files or resort to a different method.   Th emost basic export scenario from the Exchange powershell prompt is in the format: Exchange 2007:

Export-Mailbox -Identity <MailBoxUserName> -PSTFilderPath "x:\somepath"

Exchange 2010 & 2013:

New-MailBoxExportRequest -Mailbox <MailBoxUserName> -FilePath \\server\share\filename.pst

To view running exports:

Get-MailBoxExportRequest

After submission your request will be listed as “Queued,” then “InProgress” and finaly as “Completed” Completed exports will remain visible in exchange, to clean up after completion use the cmdlet:

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