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
View original