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

Restore-VEODDocument

Short Description

Restores OneDrive documents.

Syntax

This cmdlet provides 2 parameter sets.

  • For restoring a specific OneDrive document:

Restore-VEODDocument [-Document] <VBOOneDriveDocument[]> [-RestoreChangedItems] [-SkipSharedAccessNotificationSending] [-RestoreDeletedItems] [-RestorePermissions] [-Credential <pscredential>] [-TargetUser <string>] [-TargetFolder <string>] [-Overwrite]  [<CommonParameters>]

  • For restoring all documents of a specific OneDrive user:

Restore-VEODDocument [-User] <VBOOneDriveUser> [-RestoreChangedItems] [-SkipSharedAccessNotificationSending] [-RestoreDeletedItems] [-RestorePermissions] [-Credential <pscredential>] [-TargetUser <string>] [-TargetFolder <string>] [-Overwrite]  [<CommonParameters>]

  • For restoring documents of multiple OneDrive users:

Restore-VEODDocument [-MultipleUsers] <VBOOneDriveUser[]> [-SkipUnresolvedUsers] [-Credential <pscredential>] [-Office365Credential <pscredential>] [-OnPremisesCredential <pscredential>] [-Overwrite]  [<CommonParameters>]

Detailed Description

This cmdlet restores OneDrive documents.

To perform restore operations, you must first start a restore session. For more information, see Start-VEODRestoreSession.

Restore-VEODDocument 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

Document

Specifies OneDrive document. This cmdlet will restore specified OneDrive documents.

True

0

True (ByValue)

False

RestoreChangedItems

Indicates that the cmdlet will restore all versions of OneDrive documents that were modified by the user.

False

Named

False

False

RestoreDeletedItems

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

False

Named

False

False

RestoreSharedAccess

Indicates that the cmdlet will restore shared access permissions with the restored document.

False

Named

False

False

SkipSharedAccessNotificationSending

If indicted, the cmdlet will not send shared access notifications.

False

Named

False

False

Credential

Specifies the account credentials you want to use for connecting to the OneDrive server.

If omitted, the cmdlet will use a currently logged in user's Windows account credentials for connecting to the OneDrive server.

False

Named

False

False

TargetUser

Specifies the restore target OneDrive user. This cmdlet will restore OneDrive document to the specified user.

False

Named

False

False

TargetFolder

Specifies the restore target OneDrive folder. This cmdlet will restore OneDrive document to the specified folder.

False

Named

False

False

Overwrite

Indicates that the cmdlet will overwrite the items with the same name in the target directory.

False

Named

False

False

User

Specifies OneDrive user that the cmdlet will restore documents from.

True

0

True (ByValue)

False

MultipleUsers

Specifies OneDrive users that the cmdlet will restore documents from.

This cmdlet will restore documents to the production versions of the same OneDrive users.

True

0

True (ByValue)

False

SkipUnresolvedUsers

Indicates that the cmdlet will skip the unresolved users during the work of the cmdlet.

False

Named

False

False

Office365Credential

Specifies the credentials you want to use for authenticating with Microsoft Office 365 organization.

NOTE: type the organization username in one of the formats: "username@domain.com" or "user@domain.onmicrosoft.com".

False

Named

False

False

OnPremisesCredential

Specifies the credentials you want to use for authenticating with on-premises components.

NOTE: type the organization username in the domain\account format.

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 a OneDrive document with the name "document.txt" with all of its children from the user with the name "userAlpha" if you get the name of the document:

  1. Run Get-Credential to create a credential object. Type Windows credentials for connecting to the OneDrive organization. Save the result to the $credentials variable
  2. Run Get-VEODRestoreSession to get the active restore session. Save the result to the $session variable.
  3. Run Get-VEODUser with the $session variable to get the user. Save the result to the $user variable.
  4. Run Get-VEODDocument with the $user variable and Name parameter to get the specific OneDrive document. Use the Recurse parameter to also get all of its children.
  5. Run Restore-VEODDocument with the $document and $credentials variables to restore the "document.txt" to the production OneDrive user. Use TargetFolder parameter to specify the folder to which the cmdlet will perform a restore.

PS C:\PS> $credentials = Get-Credential

PS C:\PS> $session = Get-VEODRestoreSession

PS C:\PS> $user = Get-VEODUser -Session $session -Name “userAlpha”

PS C:\PS> $document = Get-VEODDocument -User $user -Name “document.txt” -Recurse

PS C:\PS> Restore-VEODDocument -Document $document -RestoreChangedItems -RestoreDeletedItems -Credential $creds -TargetUser “userBeta” -TargetFolder "NewFolder" -Overwrite

Example 2

This example shows how to restore all OneDrive documents from the user with the name "userAlpha":

  1. Run Get-Credential to create a credential object. Type Windows credentials for connecting to the OneDrive organization. Save the result to the $credentials variable
  2. Run Get-VEODRestoreSession to get the active restore session. Save the result to the $session variable.
  3. Run Get-VEODUser with the $session variable to get the user. Save the result to the $user variable.
  4. Run Restore-VEODDocument with the $user and $credentials variables to restore the documents of the user with the name "userAlpha" to the production OneDrive user with the name "userBeta". Use TargetFolder parameter to specify the folder to which the cmdlet will perform a restore.

PS C:\PS> $credentials = Get-Credential

PS C:\PS> $session = Get-VEODRestoreSession

PS C:\PS> $user = Get-VEODUser -Session $session -Name “userAlpha”

PS C:\PS> Restore-VEODDocument -User $user -RestoreChangedItems -RestoreDeletedItems -Credential $credentials -TargetUser “userBeta” -TargetFolder "NewFolder" -Overwrite

Example 3

This example shows how to restore OneDrive documents from multiple users:

  1. Run Get-Credential to create the credential objects. Type credentials for connecting to the selected organization. Save the result to the $credentials variable
  2. Run Get-VEODRestoreSession to get the active restore session. Save the result to the $session variable.
  3. Run Get-VEODUser with the $session variable to get the users. Save the result to the $users variable.
  4. Run Restore-VEODDocument with the $users and $credentials variables to restore the documents of the selected users to the production versions of the same OneDrive users. To overwrite items with the same name, use Overwrite parameter.

PS C:\PS> $o365credentials = Get-Credential

PS C:\PS> $onPremisesCredentials = Get-Credential

PS C:\PS> $session = Get-VEODRestoreSession

PS C:\PS> $users = Get-VEODUser -Session $session

PS C:\PS> Restore-VEODDocument -MultipleUser $users -Office365Credential $o365credentials -OnPremisesCredential $onPremisesCredentials -Overwrite -SkipUnresolvedUsers

Veeam Large Logo

User Guide

RESTful API Reference

PowerShell Reference