We help IT Professionals succeed at work.
Get Started

"New-MailboxRestoreRequest" issue with hard deleted O365 hybrid account

Westy
Westy asked
on
518 Views
Last Modified: 2020-05-05
In hybrid mode with users still managed by on-prem AD with some mailboxes migrated to O365. A users synced O365 account was hard delted by mistake and the user was resync'd  with a new O365 mailbox which has been in use.

"Get-Mailbox -SoftDeletedMailbox" returns the deleted mailbox but running the recover option returns the below error as expected

This mailbox cannot be restored with the Undo-SoftDeletedMailbox cmdlet since the user that was associated with the mailbox has been permanently deleted. You can however recover the contents of this mailbox using the New-MailboxRestoreRequest cmdlet.

Ran the New-MailboxRestoreRequest but I get a source database error as per below, which is a parameter I thought I didn't need as the users O365 account/mailbox was deleted, not one located on the on prem Exchange.

New-MailboxRestoreRequest -sourcestoremailbox "Jaxxx Maxxxxxx_68eeaca40f" -TargetMailbox "James Maxxxxxx"
Cannot process command because of one or more missing mandatory parameters: SourceDatabase.


Did the below to get the Mailbox database

Get-Mailbox -SoftDeletedMailbox | FL Name,Database
Name     : Jxxxx Maxxxxxx_68eeaca40f
Database : EURPR02DG041-db079


and tried a "New-MailboxRestoreRequest" again but get an error telling me the database parameter is wrong

New-MailboxRestoreRequest -sourcedatabase "EURPR02DG041-db079" -sourcestoremailbox "Jxxxx Maxxxxxx_68eeaca40f" -TargetMailbox "James Maxxxxxx"
A parameter cannot be found that matches parameter name 'sourcedatabase'.
    + CategoryInfo          : InvalidArgument: (:) [New-MailboxRestoreRequest], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-MailboxRestoreRequest
    + PSComputerName        : outlook.office365.com


Am in a bit of a loop now as, use the parameter and it is wrong, take it out and it says I need it. Would appreciate some advice please.
Comment
Watch Question
Architect
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE