|
To use the Exchange Management Shell to export mailbox data in Exchange 2007 SP1
--------------------------------------------------------------------------------
To export the special folders and empty folders of the mailbox to a folder in the destination mailbox, run the following command:
Copy
Export-Mailbox -Identity <MailboxIdParameter> -TargetMailbox <MailboxIdParameter> -TargetFolder <Folder_Name>
To export data to a .pst file, run the following command:
Copy
Export-Mailbox -Identity <MailboxIdParameter> -PSTFolderPath <Path_Of_PST_Folder>\<File_Name>.pst
To export data from a group of mailboxes, such as all mailboxes for which the user title begins with "VP," run the following command:
Copy
Get-User | where { $_.Title -ilike "VP*" } | Export-Mailbox -TargetFolder <Folder_Name> -TargetMailbox <MailboxIdParameter>
To export data that was received between specific dates to a .pst file, run the following command:
Copy
Export-Mailbox -Identity <MailboxIdParameter> -StartDate "<Month/Day/Year>" -EndDate "<Month/Day/Year>" -PSTFolderPath <Path_Of_PST_Folder>\<File_Name>.pst
To export only data from the Sent Items folder, run the following command:
Copy
Export-Mailbox -Identity <MailboxIdParameter> -IncludeFolders '\Sent Items' -TargetFolder <Target_Folder_Name> -TargetMailbox <MailboxIdParameter>
To exclude folders from the export, such as excluding items in the Junk E-Mail and Contacts folders, run the following command:
Copy
Export-Mailbox -TargetMailbox <MailboxIdParameter> -TargetFolder <Target_Folder_Name> -ExcludeFolders "\Junk E-Mail","\Contacts"
To use filters to specify which items in the source mailbox to include in the export, run the following command:
Copy
Export-Mailbox -Identity <MailboxIdParameter> -TargetMailbox <MailboxIdParameter> -TargetFolder <Target_Folder_Name> -ContentKeywords "<String[]>" -AttachmentFilenames "<String[]>" -StartDate "<Month/Day/Year> <Time>" -RecipientKeywords <String[]>
To find and delete items from a group of mailboxes, such as all mailboxes on a database, run the following command:
Copy
Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent
This example first gets all the mailboxes on database DB1 and then searches for items that contain the string "Virus message" in the subject line. It will export the items to the mailbox ExportMailbox and will delete those items from the source mailbox.
To find and delete items from a group of mailboxes, such as all mailboxes on a database, without exporting the items to another mailbox, run the following command:
Copy
Get-Mailbox -Database DB1 | Export-Mailbox -SubjectKeywords "Virus message" -DeleteContent
This example first gets all the mailboxes on database DB1, searches for items that contain the string "Virus message" in the subject, and deletes those items.
To export data from all the mailboxes of users in the Marketing organizational unit, run the following command:
Copy
Get-Mailbox -OrganizationalUnit Marketing | Export-Mailbox -PSTFolderPath C:\PSTFiles
This example exports the data from each mailbox to a separate .pst file located at C:\PSTFiles. The name of each .pst file will be <alias>.pst.
For detailed syntax and parameter information, see the Export-Mailbox reference topic.
|
|