Help Center
Choose product document...
Veeam Backup for Microsoft Office 365
PowerShell Reference

Restore-VEXItem

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.

Restore-VEXItem Note:

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
Pipeline
Input

Accept
Wildcard
Characters

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
Mailbox

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
Changed
Item

Indicates that the cmdlet will restore all versions of mailbox items that were modified by the user.

False

Named

False

False

Restore
Deleted
Item

Indicates that the cmdlet will restore mailbox items that were deleted by the user.

False

Named

False

False

Mark
AsUnread

Indicates that the cmdlet will mark the restored mailbox items as unread.

False

Named

False

False

Exclude
Deleted
Items

Indicates that the cmdlet will not restore the Deleted Items mailbox folder.

False

Named

False

False

Exclude
Drafts

Indicates that the cmdlet will not restore the Drafts mailbox folder.

False

Named

False

False

Exclude
InPlaceHold
Items

Indicates that the cmdlet will not restore preserved items of mailboxes placed on In-Place Hold.

False

Named

False

False

Exclude
LitigationHold
Items

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:

  1. 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.
  1. 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.
  2. 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:

  1. 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.
  1. 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.
  2. 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:

  1. 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.
  1. 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.
  2. 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

Get-VEXDatabase

Get-VEXMailbox

Get-VEXFolder

Get-VEXItem

Veeam Large Logo

User Guide

RESTful API Reference

PowerShell Reference