Import Mailbox Data
[This topic's current status is: Incorp Bug Fix.]
By default, the Import-Mailbox cmdlet imports all empty folders, special folders, and subfolders from a .pst file to the target location. When importing folders, you can include or exclude the following special folders:
- Deleted Items
- Junk E-mail
- Sent Items
From each of these folders, the Import-Mailbox cmdlet imports the following messages:
- All folder messages if they exist in the .pst file. Messages contain hidden data with information about rules, views, and forms.
- All messages from the transport dumpster if they exist in the .pst file.
- All message types, including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents.
When data is imported from a .pst file, it's merged into the existing mailbox. If a message from the .pst file already exists, it won't be imported as a duplicate message.
Looking for other management tasks related to importing or exporting mailbox data? Check out Managing Mailbox Import and Export.
You can't use the Exchange 2010 Import-Mailbox cmdlet to import data to a mailbox on a server running Exchange Server 2007 or Exchange Server 2003. To import data to a mailbox running Exchange 2007, use the Exchange 2007 Import-Mailbox cmdlet on a server that meets Exchange 2007 requirements. To import data from a .pst file to a mailbox on a server running Exchange 2003, you must use the Microsoft Exchange Server Mailbox Merge wizard (ExMerge.exe).
You can't import data to a public folder or public folder database.
- To import mailbox data, you must run the Import-Mailbox cmdlet against a 64-bit computer that has the following installed:
- Microsoft Exchange Server 2010 role
- 64-bit Microsoft Outlook 2010
- You must have the correct permissions to import or export mailbox data. By default, none of the preloaded role groups contain the Mailbox Import Export role. Therefore, you must add the Mailbox Import Export role to a role group. For more information, see Add the Mailbox Import Export Role to a Role Group.
- The mailbox to which you're importing the data must exist. You can't import data to a user account that doesn't have a mailbox.
Use the Shell to import mailbox data
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Import\Export mailbox" entry in the Mailbox Permissions topic.
You can't use the EMC to import mailbox data.
This example imports data from the john.pst file to the mailbox belonging to email@example.com.
Import-Mailbox -Identity firstname.lastname@example.org -PSTFolderPath C:\PSTFiles\john.pst
This example imports all the mailbox data from the john.pst file received between January 1, 2009, and April 1, 2009.
Import-Mailbox -Identity email@example.com -PSTFolderPath C:\PSTFiles\john.pst -StartDate 01/01/2009 -EndDate 04/01/2009
This example imports mailbox data from all the .pst files located in C:\PSTFiles into the corresponding mailboxes. The .pst files in C:\PSTFiles must each be named <alias>.pst.
Dir C:\PSTFiles\*.pst | Import-Mailbox -StartDate 01/01/2006 -EndDate 04/01/2006
This example imports mailbox data from .pst files located at C:\PSTFiles into all the mailboxes whose user accounts are in the organizational unit Students.
Get-Mailbox -OrganizationalUnit Students | Import-Mailbox -PSTFolderPath C:\PSTFiles\
This example imports all the mailbox data from the john.pst file for which firstname.lastname@example.org is the sender.
Import-Mailbox -Identity email@example.com -PSTFolderPath C:\PSTFiles\john.pst -SenderKeywords firstname.lastname@example.org
This example imports only the mailbox data from the john.pst file in the Sent Items folder.
Import-Mailbox -Identity john -PSTFolderPath C:\PSTFiles\john.pst -IncludeFolders '\Sent Items'
This example excludes the Junk E-mail and Contacts folders from the import,
Import-Mailbox -Identity john -PSTFolderPath C:\PSTFiles\john.pst ExcludeFolders "\Junk E-mail","\Contacts"
By using the filters, this example imports all items from the john.pst file that meet the following criteria:
- Contain the keyword merger in the message body or in the content of an attachment.
- Have an attachment named orgchart.
- Are dated later than March 1, 2006, at 00:01 (12:01 A.M.).
- Have email@example.com as one of the recipients.
Import-Mailbox -Identity contoso\john -PSTFolderPath C:\PSTFiles\john.pst -ContentKeywords "merger" -AttachmentFilenames "*orgchart*" -StartDate "03/01/2006 12:01:00" -RecipientKeywords firstname.lastname@example.org
For detailed syntax and parameter information, see Import-Mailbox.