This is an archive version of the document. To get the most up-to-date information, see the current version.

Restore-VEODDocument

In this article

    Short Description

    Restores OneDrive documents.

    Applies to Veeam Backup for Microsoft Office 365

    Product Edition: Community, Rental, Subscription

    Syntax

    This cmdlet provides parameter sets that allow you to:

    • 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 on common parameters, see the About CommonParameters section of Microsoft Docs.

    Example 1

    This example shows how to restore the document.txt OneDrive document with all its userAlpha children items from the user.

    1. Run the Get-Credential cmdlet to create a credential object. Type Windows credentials to connect to the OneDrive organization. Save the result to the $credentials variable
    2. Run the Get-VEODRestoreSession cmdlet to get an active restore session. Save the result to the $session variable.
    3. Run the Get-VEODUser cmdlet with the $session variable to get the user. Save the result to the $user variable.
    4. Run the Get-VEODDocument cmdlet 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 the Restore-VEODDocument cmdlet 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.

    $credentials = Get-Credential

    $session = Get-VEODRestoreSession

    $user = Get-VEODUser -Session $session -Name “userAlpha”

    $document = Get-VEODDocument -User $user -Name “document.txt” -Recurse

    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 the Get-Credential cmdlet to create a credential object. Type Windows credentials to connect to the OneDrive organization. Save the result to the $credentials variable
    2. Run the Get-VEODRestoreSession cmdlet to get an active restore session. Save the result to the $session variable.
    3. Run the Get-VEODUser cmdlet with the $session variable to get the user. Save the result to the $user variable.
    4. Run the Restore-VEODDocument cmdlet 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.

    $credentials = Get-Credential

    $session = Get-VEODRestoreSession

    $user = Get-VEODUser -Session $session -Name “userAlpha”

    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 the Get-Credential cmdlet to create a credential object. Type credentials for connecting to the selected organization. Save the result to the $credentials variable
    2. Run the Get-VEODRestoreSession cmdlet to get an active restore session. Save the result to the $session variable.
    3. Run the Get-VEODUser cmdlet with the $session variable to get the users. Save the result to the $users variable.
    4. Run the Restore-VEODDocument cmdlet 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.

    $o365credentials = Get-Credential

    $onPremisesCredentials = Get-Credential

    $session = Get-VEODRestoreSession

    $users = Get-VEODUser -Session $session

    Restore-VEODDocument -MultipleUser $users -Office365Credential $o365credentials -OnPremisesCredential $onPremisesCredentials -Overwrite -SkipUnresolvedUsers

    Related Commands