Maintain control of your Microsoft 365 data
Post Reply
roguegeek
Novice
Posts: 9
Liked: never
Joined: Jun 29, 2018 1:07 pm
Contact:

Start-VEODRestoreSession -ShowAllVersions

Post by roguegeek »

Anyone else have any luck using this PS command with the -ShowAllVersions switch? I am able to create the restore session but when I collect all the documents for a user's onedrive using that session it only shows the most recent version of any document. Anyone know of any other way to restore ALL versions of a OneDrive document using PS?
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start-VEODRestoreSession -ShowAllVersions

Post by nielsengelen »

Here is an example. This will restore a file in a folder named "Test". Just replace the following:
- YOURORG
- USERNAME
- FILE-EXAMPLE.TXT

You can then see the versions in OneDrive. Important is that within the Restore-VEODDocument cmdlet you use "-RestoreChangedItems".

Code: Select all

Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

$org = Get-VBOOrganization -Name "YOURORG"
$session = Start-VEODRestoreSession -LatestState -ShowAllVersions -Organization $org
$user = Get-VEODUser -Name "USERNAME" -Session $session
$file = Get-VEODDocument -User $user -Name "FILE-EXAMPLE.TXT" 
Restore-VEODDocument -Document $file -RestoreChangedItems -TargetFolder "Test"
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests