Help Center
Choose product document...
Veeam Backup & Replication 9.5 Update 4
Veeam Explorers PowerShell Reference

Restore-VEODDocument

Short Description

Restores OneDrive documents.

Applies to Veeam Backup for Microsoft Office 365

Product Edition: Community, Rental, Subscription

Syntax

This cmdlet provides the following parameter sets.

  • To restore a specific OneDrive document:

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

  • To restore all documents of a specific OneDrive user:

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

  • To restore 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 the PSCredential object. Use the Get-Credential cmdlet to create the PSCredentials object. For detailed instructions on how to run Get-Credential, see this Microsoft article.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

Document

Specifies the 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: specify the organization username in the domain\account format.

False

Named

False

False

OnPremisesCredential

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

NOTE: specify 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 the document.txt OneDrive document with all its userAlpha children items from the user.

  1. Run Get-Credential to create a credential object. Type Windows credentials to connect to the OneDrive organization. Save the result to the $credentials variable
  2. Run Get-VEODRestoreSession to get an 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 the 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 document 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 userAlpha user.

  1. Run Get-Credential to create a credential object. Type Windows credentials to connect to the OneDrive organization. Save the result to the $credentials variable
  2. Run Get-VEODRestoreSession to get an 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 userAlpha user to the production userBeta user with the name  Use the 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 an 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 the 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

Related Commands

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Explorers User Guide

Backup and Restore of SQL Server Databases

Veeam Plug-ins for Enterprise Applications

PowerShell Reference

Veeam Explorers PowerShell Reference

RESTful API Reference

Required Permissions

Veeam Availability for Nutanix AHV

Veeam Backup for Microsoft Office 365 Documentation

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation