Short Description
Restores Exchange organization's backups.
Syntax
This cmdlet provides 3 parameter sets.
- For restoring an Exchange organization's mailbox:
Restore-VEXItem -Mailbox <VEXMailbox> [-Server <String>] [-TargetMailbox <String>] -Credential <PSCredential> [-ToFolder <String>] [-RestoreChangedItem [<SwitchParameter>]] [-RestoreDeletedItem [<SwitchParameter>]] [-MarkAsUnread [<SwitchParameter>]] [-Force [<SwitchParameter>]] [-ExcludeDrafts [<SwitchParameter>]] [-ExcludeDeletedItems [<SwitchParameter>]] [-ExcludeInPlaceHoldItems [<SwitchParameter>]] [-ExcludeLitigationHoldItems [<SwitchParameter>]] [<CommonParameters>] |
- For restoring an Exchange organization's mailbox folder:
Restore-VEXItem -Folder <VEXFolder> [-Server <String>] [-TargetMailbox <String>] -Credential <PSCredential> [-ToFolder <String>] [-RestoreChangedItem [<SwitchParameter>]] [-RestoreDeletedItem [<SwitchParameter>]] [-MarkAsUnread [<SwitchParameter>]] [-Force [<SwitchParameter>]] [<CommonParameters>] |
- For restoring Exchange organization's mailbox items:
Restore-VEXItem -Item <VEXItem[]> [-Server <String>] [-TargetMailbox <String>] -Credential <PSCredential> [-ToFolder <String>] [-RestoreChangedItem [<SwitchParameter>]] [-RestoreDeletedItem [<SwitchParameter>]] [-MarkAsUnread [<SwitchParameter>]] [-Force [<SwitchParameter>]] [<CommonParameters>] |
Detailed Description
This cmdlet restores Exchange organization's mailbox backups.
To perform restore operations, you must first start a restore session. For more information, see Start-VBOExchangeItemRestoreSession.
|
This cmdlet requires a PSCredential object. Use Get-Credential to create the PSCredentials object. For more information on Get-Credential, see https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.security/get-credential. |
Parameters
Parameter | Description | Required | Position | Accept | Accept |
Item | Specifies the array of Exchange organization's mailbox items that you want to restore. | True | Named | True (ByValue) | False |
Folder | Specifies an Exchange organization's mailbox folder that you want to restore. The cmdlet will restore this folder with all its subfolders. | True | Named | True (ByValue) | False |
Mailbox | Specifies an Exchange organization's mailbox that you want to restore. | True | Named | True (ByValue) | False |
Server | Specifies the Microsoft Exchange server with Client Access Server (CAS) role. The cmdlet will perform a restore to this mailbox server. | False | Named | False | False |
Target | Specifies an Exchange organization's mailbox. The cmdlet will perform a restore to this mailbox. Note that the mailbox should be in the "username@domain" format. If this parameter is omitted, the cmdlet will perform a restore to the same mailbox on the production Exchange server. | False | Named | False | False |
Credential | Specifies the account credentials you want to use for connecting to the Microsoft Exchange server. If omitted, the cmdlet will use a currently logged in user's Windows account credentials for connecting to the Microsoft Exchange server. | False | Named | False | False |
ToFolder | Specifies the mailbox folder. The cmdlet will restore backups to this folder. | False | Named | False | False |
Restore | Indicates that the cmdlet will restore all versions of mailbox items that were modified by the user. | False | Named | False | False |
Restore | Indicates that the cmdlet will restore mailbox items that were deleted by the user. | False | Named | False | False |
Mark | Indicates that the cmdlet will mark the restored mailbox items as unread. | False | Named | False | False |
Exclude | Indicates that the cmdlet will not restore the Deleted Items mailbox folder. | False | Named | False | False |
Exclude | Indicates that the cmdlet will not restore the Drafts mailbox folder. | False | Named | False | False |
Exclude | Indicates that the cmdlet will not restore preserved items of mailboxes placed on In-Place Hold. | False | Named | False | False |
Exclude | Indicates that the cmdlet will not restore the preserved items of mailboxes placed on Litigation Hold. | False | Named | False | False |
Force | Indicates that the cmdlet will perform a restore without notifying the user. | 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 restore mailbox items to the production Microsoft Exchange server.
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 Get-Credential to create a credential object. Type the credentials you want to use for connecting to the Microsoft Exchange server. Save the result to the $creds variable.
- Run Restore-VEXitem with the $salesmailbox and $creds variables.
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> $creds = Get-Credential PS C:\PS> Restore-VEXItem -Mailbox $salesmailbox -Server outlook.office365.com -Credential $creds -RestoreChangedItem |
Example 2
This example shows how to restore the "Contacts" folder to the mailbox with the name "sales@abc.onmicrosoft.com" on the production Microsoft Exchange server.
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 Get-Credential to create a credential object. Type the credentials you want to use for connecting to the Microsoft Exchange server. Save the result to the $creds variable.
- Run Restore-VEXitem with the $contacts and $creds variables to restore the "Contacts" folder to the production Microsoft Exchange server. Use TargetMailbox parameter to specify the mailbox to which the cmdlet will perform a restore.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $salesmailbox = Get-VEXMailbox -Database $database -Name "north.sales" PS C:\PS> $contacts = Get-VEXFolder -Mailbox $salesmailbox -Name "Contacts" PS C:\PS> $creds = Get-Credential PS C:\PS> Restore-VEXItem -Folder $contacts -Server outlook.office365.com -Credential $creds -TargetMailbox "sales@abc.onmicrosoft.com" -RestoreChangedItem |
Example 3
This example shows how to restore all mailbox items from the "Contacts" folder and its subfolders to the production Microsoft Exchange server.
You will need to perform the following steps:
- Get all items from the "Contacts" folder and save them to the $contactitems 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 Recurse parameter to get items from the parent folder and its subfolders. Save the result to the $contactitems variable.
- Run Get-Credential to create a credential object. Type the credentials you want to use for connecting to the Microsoft Exchange server. Save the result to the $creds variable.
- Run Restore-VEXitem with the $contacts and $creds variables to restore all items from the "Contacts" folder and its subfolders to the production Microsoft Exchange server.
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> $contactitems = Get-VEXItem -Folder $contacts -Recurse PS C:\PS> $creds = Get-Credential PS C:\PS> Restore-VEXItem -Item $contactitems -Server outlook.office365.com -Credential $creds -RestoreChangedItem -RestoreDeletedItem |
Related Commands
Get-VBOExchangeItemRestoreSession