SOLVED

Hybrid EXO - The execution of cmdlet Set-SyncMailUser failed

%3CLINGO-SUB%20id%3D%22lingo-sub-1802039%22%20slang%3D%22en-US%22%3EHybrid%20EXO%20-%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1802039%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3ESo%20we%20have%20following%20situation%3A%3C%2FP%3E%3CP%3EHybrid%20environment%3C%2FP%3E%3CP%3EStaff%20member%20with%20migrated%20(remote)%20mailbox%20leaves%20the%20company%3C%2FP%3E%3CP%3Elicense%20is%20removed%3C%2FP%3E%3CP%3Euser%20is%20moved%20into%20a%20non-sync%20OU%20and%20O365%20mailbox%20is%20moved%20into%20deleted%20users%3C%2FP%3E%3CP%3Eafter%20the%20grace%20period%2C%20mailbox%20is%20deleted%3C%2FP%3E%3CP%3Esame%20users%20comes%20back%20in%20the%20company%20few%20months%20later%20(after%20the%20grace%20period%20of%20the%20mailbox)%20and%20the%20same%20AD%20account%20is%20re-enabled%20and%20re-synced%20with%20O365%3C%2FP%3E%3CP%3EIn%20the%20on-prem%20exchange%20console%20the%20same%20mailbox%20is%20showing%20as%20%3A%20Remote%20O365%20mailbox%3C%2FP%3E%3CP%3Ebut%20in%20EXO%20is%20nothing%2C%20no%20mailbox%3C%2FP%3E%3CP%3Eassigning%20license%20returns%20error%3A%26nbsp%3B%3CSPAN%20class%3D%22ms-MessageBar-innerText%20innerText-498%22%3E%3CSPAN%3EExchange%3A%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed..%3B%20Exchange%3A%20An%20unknown%20error%20has%20occurred.%20Refer%20to%20correlation%20ID%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20if%20try%20to%20perform%20new-moverequest%20also%20returns%20error%3A%3C%2FP%3E%3CP%3EThe%20operation%20couldn't%20be%20performed%20because%20object%20'returning-staff%40abc.xyz'%20couldn't%20be%20found%20on%20'........PROD.OUTLOOK.COM'.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20checked%20the%20Error%20field%20via%20MSOL%2C%20but%20showing%20nothing%2C%20literally%20empty%20space%3C%2FP%3E%3CP%3EAlso%20checked%20the%20%22msExchHomeServerName%22%20its%20all%20clear%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20what%20else%20to%20look%20for%2Fchange%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1802039%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ehybrid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOutlook%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1802352%22%20slang%3D%22en-US%22%3ERe%3A%20Hybrid%20EXO%20-%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1802352%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20run%20a%20Full%20sync%20cycle%20after%20moving%20the%20user%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1805639%22%20slang%3D%22en-US%22%3ERe%3A%20Hybrid%20EXO%20-%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1805639%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20several%20times%20pushed%20the%20sync%3C%2FP%3E%3CP%3EOtherwise%20the%20user%20wouldnt%20appear%20in%20the%20O365%20User%60s%20list%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1828520%22%20slang%3D%22en-US%22%3ERe%3A%20Hybrid%20EXO%20-%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1828520%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F640620%22%20target%3D%22_blank%22%3E%40Anton5032%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERisual.com%20have%20a%20nice%20blog%20on%20how%20to%20resolve%20this%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.risual.com%2F2019%2F03%2Fexchange-online-unknown-error-has-occurred-in-hybrid-environment%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.risual.com%2F2019%2F03%2Fexchange-online-unknown-error-has-occurred-in-hybrid-environment%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hello

So we have following situation:

Hybrid environment

Staff member with migrated (remote) mailbox leaves the company

license is removed

user is moved into a non-sync OU and O365 mailbox is moved into deleted users

after the grace period, mailbox is deleted

same users comes back in the company few months later (after the grace period of the mailbox) and the same AD account is re-enabled and re-synced with O365

In the on-prem exchange console the same mailbox is showing as : Remote O365 mailbox

but in EXO is nothing, no mailbox

assigning license returns error: Exchange: The execution of cmdlet Set-SyncMailUser failed..; Exchange: An unknown error has occurred. Refer to correlation ID

 

and if try to perform new-moverequest also returns error:

The operation couldn't be performed because object 'returning-staff@abc.xyz' couldn't be found on '........PROD.OUTLOOK.COM'.

 

I checked the Error field via MSOL, but showing nothing, literally empty space

Also checked the "msExchHomeServerName" its all clear

 

Not sure what else to look for/change

 

4 Replies
Highlighted

Did you run a Full sync cycle after moving the user? 

Highlighted

@Vasil Michev 

Yes, several times pushed the sync

Otherwise the user wouldnt appear in the O365 User`s list

Highlighted
Best Response confirmed by Anton5032 (Occasional Contributor)
Highlighted
Thanks @Yasin10

That blog did the trick and now everything is clear and operational

It is a shame MS havent provided faster (more automated) way to do this. I cant believe we are the only one out there having contractors come and go in the business all the time. Its kinda dumb to have to go through all the steps everytime when that happens.

Thank you again!