The Export-Mailbox cmdlet exports all message types including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents.
The Export-Mailbox cmdlet also exports messages from the dumpster. Messages from the dumpster are converted to regular items in the folder or .pst file to which you export data.
Here are some examples.
- To export the special folders and empty folders of the mailbox
user John to a folder named MyData on the mailbox
Export-Mailbox -Identity email@example.com -TargetMailbox ExportMailbox -TargetFolder MyData
- To export data to a .pst file that is named john.pst located at
Export-Mailbox -Identity firstname.lastname@example.org -PSTFolderPath C:\PSTFiles\john.pst
- To export data from all the mailboxes of users in the Contoso
Get-Mailbox -OrganizationalUnit "OU=Contoso,OU=ConsolidatedMessenger,OU=Hosting,DC=Fabrikam,DC=com" | Export-mailbox -PSTFolderPath c:\PSTFiles
This example exports the data from each mailbox to a separate .pst file that is located at C:\PSTFiles. The name of each .pst file will be <alias>.pst.
For more examples, see How to Export Mailbox Data.