Skip to main content
Solved

Restoring OneDrive via PowerShell cannot find Online library


  • Comes here often
  • 13 comments

I’m using Veeam Backup for Microsoft Office 365 version 4.0 and want to copy all of the OneDrive data from users into their new accounts

 

$DestinationSubfolder = 'Restored Work'
$VeeamBackupJobName = 'BMC_M365_Data'
$M365Credentials = Get-Credential
$Job = Get-VBOjob -Name $VeeamBackupJobName
$Session = Start-VEODRestoreSession -Job $Job -LatestState
$UserToRestore = Get-VEODUser -Session $Session -Name 'Joe Bloggs'
$UserDocuments = Get-VEODDocument -User $UserToRestore
if($UserDocuments)
{
    $TargetUserName = 'Joe Bloggs 2'
    Restore-VEODDocument -User $UserToRestore -RestoreChangedItems -RestoreDeletedItems -Credential $M365Credentials -TargetUser $TargetUserName -TargetFolder $DestinationSubfolder
}
Else
{
    'No OneDrive content found.'
}
Get-VEODRestoreSession | Stop-VEODRestoreSession

 

The commands return this error though:

“Restore-VEODDocument : Failed to find Online OneDrive library for: Joe Bloggs 2”

I’ve added the second account to the original backup job to ensure Veeam can see it. Any idea what the problem might be?

Thanks.

Best answer by MicoolPaul

First things first, you should test this in the latest version, which is currently VB365 v7, there’ve been many breaking changes over the years. If you can test in a supported version that the issue still occurs and if the error changes that’ll be the best first step please.

View original
Did this topic help you find an answer to your question?

4 comments

MicoolPaul
Forum|alt.badge.img+23
  • 2358 comments
  • Answer
  • May 17, 2023

First things first, you should test this in the latest version, which is currently VB365 v7, there’ve been many breaking changes over the years. If you can test in a supported version that the issue still occurs and if the error changes that’ll be the best first step please.


  • Author
  • Comes here often
  • 13 comments
  • May 17, 2023

Thanks for the suggestion. I’ve actually got it working in the meantime by testing the backup in the GUI. Once I did that, the PS version worked fine.

So, I guess Veeam “couldn’t see” my target user, for want of a better word? Is there something I should do to ensure that? This morning I used Get-VEODUser to check the account and I could query it without issue. Any suggestions?

Cheers again.


dips
Forum|alt.badge.img+7
  • Veeam Legend
  • 808 comments
  • May 26, 2023

Hi @KWCork 

It might be worth running ‘Get-VEODUser’ first to get a list of the users and then perform the restore. That way, you will have a list of the users before beginning the restore session. 


  • Author
  • Comes here often
  • 13 comments
  • July 19, 2023
MicoolPaul wrote:

First things first, you should test this in the latest version, which is currently VB365 v7, there’ve been many breaking changes over the years. If you can test in a supported version that the issue still occurs and if the error changes that’ll be the best first step please.

I’ve just now had a chance to install a trial of version 7, and yup, that works no problem.

Cheers!