Short Description
Exports Exchange organization's backups.
Syntax
This cmdlet provides 4 parameter sets.
- For exporting Exchange organization's mailbox databases:
Export-VEXItem -Database <VEXDatabase[]> -To <string> [-Force] [-ContentKeyword <string[]>] [<CommonParameters>] |
- For exporting an Exchange organization's mailbox:
Export-VEXItem -Mailbox <VEXMailbox> -To <string> [-Force] [-ContentKeyword <string[]>] [<CommonParameters>] |
- For exporting an Exchange organization's mailbox folder:
Export-VEXItem -Folder <VEXFolder> -To <string> [-Force] [-ContentKeyword <string[]>] [<CommonParameters>] |
- For exporting Exchange organization's mailbox items:
Export-VEXItem -Item <VEXItem[]> -To <string> [-Force] [<CommonParameters>] |
Detailed Description
This cmdlet exports Exchange organization's mailbox databases, mailboxes, folders or mailbox items to Personal Folder Files (.PST files). Additionally, the cmdlet exports mailbox items to Outlook Message Files (.MSG files).
Note: |
Before performing export operations, check the following prerequisites:
|
Parameters
Parameter | Description | Required | Position | Accept | Accept |
Item | Specifies Exchange organization's mailbox items that you want to export. | True | Named | True (ByValue) | False |
Folder | Specifies an Exchange organization's mailbox folder that you want to export. The cmdlet will export this folder with all its subfolders. | True | Named | True (ByValue) | False |
Mailbox | Specifies an Exchange organization's mailbox that you want to export. | True | Named | True (ByValue) | False |
Database | Specifies an Exchange organization mailbox database that you want to export. | True | Named | True (ByValue) | False |
To | Specifies the path and the name for a .PST file or the path for .MSG files. To export databases, mailboxes and folders to a .PST file, specify the path and the name for the .PST file. The cmdlet will create a .PST file with the specified name if it doesn't exist. To export items to .MSG files, specify the path and the folder. The cmdlet will create a .MSG file for each item in the folder that you specified. | True | Named | False | False |
Force | Indicates that the cmdlet will perform export operations without notifying the user. | False | Named | False | False |
Content | Specifies the keyword to query Exchange organization's mailbox data. The cmdlet will look for the specified keywords in all message fields (From, To, Subject, Body). After that the cmdlet will export Exchange organization's mailbox data containing the specified keywords. | False | Named | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.
Example 1
This example shows how to export the mailbox database with the name "northsales.onmicrosoft.com" to the "North.pst" file.
You will need to perform the following steps:
- Get the mailbox database with the name "northsales.onmicrosoft.com" and save it to the $database variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable and Name parameter to get a specific mailbox database. Save the result to the $database variable.
- Run Export-VEXitem with the $database variable to export the "northsales.onmicrosoft.com" mailbox database to the "North.pst" file.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $salesmailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> Export-VEXItem -Database $database -To "C:\North Backup\North.pst" |
Example 2
This example shows how to export the "sales" mailbox to the "Sales.pst" file.
You will need to perform the following steps:
- Get the mailbox with the name "sales" and save it to the $salesmailbox variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXMailbox with the $database variable and Name parameter to get the specific mailbox from the mailbox database. Save the result to the $mailbox variable.
- Run Export-VEXitem with the $salesmailbox variable to export the "sales" mailbox to the "Sales.pst" file.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $salesmailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> Export-VEXItem -Mailbox $salesmailbox -To "C:\North Backup\Sales\Sales.pst" |
Example 3
This example shows how to export the "Contacts" folder to the "Contacts.pst" file.
You will need to perform the following steps:
- Get the mailbox folder with the name "Contacts" and save it to the $contacts variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXMailbox with the $database variable and Name parameter to get the specific mailbox from the mailbox database. Save the result to the $salesmailbox variable.
- Run Get-VEXFolder with the $salesmailbox variable and Name parameter to get the specific folder from the mailbox. Save the result to the $contacts variable.
- Run Export-VEXitem with the $contacts variable to export the "Contacts" folder to the "Contacts.pst" file.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $salesmailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> $contacts = Get-VEXFolder -Mailbox $salesmailbox PS C:\PS> Export-VEXItem -Folder $contacts -To "C:\North Backup\Sales\Contacts\Contacts.pst" |
Example 4
This example shows how to export mailbox items with the names containing "smith" from the "Contacts" folder to the "Smith Contacts.pst" file.
You will need to perform the following steps:
- Get items with names containing "smith" from the "Contacts" folder and save them to the $smith variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXMailbox with the $database variable and Name parameter to get the specific mailbox from the mailbox database. Save the result to the $mailbox variable.
- Run Get-VEXFolder with the $mailbox variable and Name parameter to get the specific folder from the mailbox. Save the result to the $contacts variable.
- Run Get-VEXItem with the $contacts variable and Query parameter to get items with names containing a specified keyword. Save the result to the $smith variable.
- Run Export-VEXitem with the $smith variable to export items with names containing "smith" from the "Contacts" folder to the "Smith Contacts.pst" file.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $mailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> $contacts = Get-VEXFolder -Mailbox $mailbox PS C:\PS> $smith = Get-VEXItem -Folder $contacts -Query "smith" PS C:\PS> Export-VEXItem -Item $smith -To "C:\North Backup\Sales\Contacts\Smith\Smith Contacts.pst" |
Example 5
This example shows how to export mailbox items with names containing "smith" from the "Contacts" folder to .MSG files.
You will need to perform the following steps:
- Get items with names containing "smith" from the "Contacts" folder and save them to the $smith variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXMailbox with the $database variable and Name parameter to get the specific mailbox from the mailbox database. Save the result to the $mailbox variable.
- Run Get-VEXFolder with the $mailbox variable and Name parameter to get the specific folder from the mailbox. Save the result to the $contacts variable.
- Run Get-VEXItem with the $contacts variable and Query parameter to get items with names containing a specified keyword. Save the result to the $smith variable.
- Run Export-VEXitem with the $smith variable to export items to .MSG files to "Smith" folder.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $mailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> $contacts = Get-VEXFolder -Mailbox $mailbox PS C:\PS> $smith = Get-VEXItem -Folder $contacts -Query "smith" PS C:\PS> Export-VEXItem -Item $smith -To "C:\North Backup\Sales\Contacts\Smith" |
Related Commands
Get-VBOExchangeItemRestoreSession