Question

Restoring M365 mailbox to other user - Restore-VEXItem : Cannot open mailbox


Userlevel 4

I want to restore a backed-up 365 mailbox to another user. I’m following the guide in the Restore-VEXItem help page:

https://helpcenter.veeam.com/docs/backup/explorers_powershell/restore-vexitem.html?ver=120

I’m following example 5:

$session = Get-VBOExchangeItemRestoreSession

$database = Get-VEXDatabase -Session $session -Name abc.onmicrosoft.com

$salesmailbox = Get-VEXMailbox -Database $database -Name "sales"

$creds = Get-Credential

Restore-VEXItem -Mailbox $salesmailbox -Server outlook.office365.com -Credential $creds -RestoreChangedItem

Except I’m restoring to another mailbox, so my last line is like:

Restore-VEXItem -Mailbox $salesmailbox -Server outlook.office365.com -Credential $creds -RestoreChangedItem -TargetMailbox $Targetmailbox

It always fails with something like

“Cannot open mailbox: myuser@mysite.com”

Veeam can find both the source and the target account using:

Get-VBOOrganizationUser -Organization $Organization -UserName ‘myuser@mysite.com’

So I’m not sure what might be wrong. Any ideas?


2 comments

Userlevel 4

It looks this was a modern authentication issue. I followed the app registration example in #6 and that seems to have worked.

Hopefully I only need to confirm my auth once per session - going to https://microsoft.com/devicelogin won’t be much use in a loop :)

Userlevel 4

Hopefully I only need to confirm my auth once per session - going to https://microsoft.com/devicelogin won’t be much use in a loop :)

 

Booo! You have to continually re-authenticate. I’ll have to find a new solution.

Comment