SOLVED

Exchange: The execution of cmdlet Set-SyncMailUser failed.

%3CLINGO-SUB%20id%3D%22lingo-sub-2957236%22%20slang%3D%22en-US%22%3EExchange%3A%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2957236%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EHi.%20We%20have%20a%20hybrid%20environment%20and%20recently%20we've%20encountered%20a%20problem%20on%20converting%20a%20disabled%20email%20account%20to%20shared%20mailbox.%20It%20was%20shown%20this%20error%20message%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%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%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EThe%20mailbox%20was%20disabled%20on%20the%20on-prem%20EAC%20and%20cannot%20be%20seen%20on%20the%20exchange%20online%20EAC%20so%20I%20suspect%20there%20was%20a%20problem%20in%20it.%20I've%20found%20that%20the%20above%20error%20can%20be%20caused%20by%20a%20guid%20conflict%20between%20the%20online%20AAD%20and%20the%20on-prem%20server%20and%20I%20tried%20the%20powershell%20in%20%3C%2FSPAN%3E%3CSPAN%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%22noopener%20nofollow%20noreferrer%22%3Ehere%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E%20but%20when%20I%20typed%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EEnable-RemoteMailbox%20%E2%80%9Cexample.user%40domain.com%E2%80%9D%20-RemoteRoutingAddress%20%E2%80%9Cexample.user%40domain.onmicrosoft.com%E2%80%9D%20-PrimarySMTPAddress%20%E2%80%9Cexample.user%40domain.com%E2%80%9D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%2C%20there%20will%20be%20an%20error%20saying%20that%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EThis%20task%20does%20not%20support%20recipients%20of%20this%20type.%20The%20specified%20recipient%20%3CUSER%3E%20is%20of%20type%20RemoteUserMailbox.%20Please%20make%20sure%20that%20this%20recipient%20matches%20the%20required%20recipient%20type%20for%20this%20task.%3C%2FUSER%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3Eget-recipient%20%3CUSERNAME%3E%20returns%3C%2FUSERNAME%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EName%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BRecipientType%3CBR%20%2F%3E----%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20-------------%3CBR%20%2F%3E%3CUSERNAME%3E%20MailUser%3C%2FUSERNAME%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3EI%20don't%20know%20where%20to%20go%20from%20now.%20Does%20anyone%20knows%20how%20to%20fix%20this%20error%3F%20Thanks.%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2957236%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHybrid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2957847%22%20slang%3D%22en-US%22%3ERe%3A%20Exchange%3A%20The%20execution%20of%20cmdlet%20Set-SyncMailUser%20failed.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2957847%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F144014%22%20target%3D%22_blank%22%3E%40Thierry%20Chapuisat%3C%2FA%3E%26nbsp%3BI%20guess%20so%20since%20the%20cmdlet%20in%20scenario%201%20is%20similar%20to%20what%20I%20followed%20in%20the%20guide.%20However%2C%20the%20cmdlet%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EEnable-RemoteMailbox%20%22user%20identity%22%20-RemoteRoutingAddress%20%22user%40contoso.mail.onmicrosoft.com%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3BFailed%20and%20the%20error%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EThis%20task%20does%20not%20support%20recipients%20of%20this%20type.%20The%20specified%20recipient%20%3CUSER%3E%20is%20of%20type%20RemoteUserMailbox.%20Please%20make%20sure%20that%20this%20recipient%20matches%20the%20required%20recipient%20type%20for%20this%20task.%3C%2FUSER%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ewill%20be%20shown.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor
Hi. We have a hybrid environment and recently we've encountered a problem on converting a disabled email account to shared mailbox. It was shown this error message:
 
Exchange: The execution of cmdlet Set-SyncMailUser failed..; Exchange: An unknown error has occurred. Refer to correlation ID...
 
The mailbox was disabled on the on-prem EAC and cannot be seen on the exchange online EAC so I suspect there was a problem in it. I've found that the above error can be caused by a guid conflict between the online AAD and the on-prem server and I tried the powershell in here but when I typed
 
Enable-RemoteMailbox “example.user@domain.com” -RemoteRoutingAddress “example.user@domain.onmicrosoft.com” -PrimarySMTPAddress “example.user@domain.com”
 
, there will be an error saying that:
 
This task does not support recipients of this type. The specified recipient <user> is of type RemoteUserMailbox. Please make sure that this recipient matches the required recipient type for this task.
 
get-recipient <username> returns
Name             RecipientType
----                -------------
<Username> MailUser
 
 
I don't know where to go from now. Does anyone knows how to fix this error? Thanks.
4 Replies

@Thierry Chapuisat I guess so since the cmdlet in scenario 1 is similar to what I followed in the guide. However, the cmdlet 

Enable-RemoteMailbox "user identity" -RemoteRoutingAddress "user@contoso.mail.onmicrosoft.com"

 Failed and the error

This task does not support recipients of this type. The specified recipient <user> is of type RemoteUserMailbox. Please make sure that this recipient matches the required recipient type for this task.

will be shown.

Yo ca try to change manually the recipient type display and the remote recipient type on your local ad.
http://www.mistercloudtech.com/2016/05/18/reference-to-msexchrecipientdisplaytype-msexchrecipienttyp...
best response confirmed by CUCOOPE (Occasional Contributor)
Solution

@Thierry Chapuisat At last I hard-matched the guid between Azure and the on-prem ad.