We have a single user that was not created correctly in Exchange on-prem. This is causing issues with SMTP mail not routing/failing to deliver to the o365 email.
In our environment, users are created in Exchange on-prem as an "Office 365" mailbox, which then creates the account in Active Directory, and Office 365.
For this user it looks like the user was created in Active Directory First, then the AD Sync synced the account to Office 365. A mail user has been created in exchange on prem, but this doesn't look like it's the solution as all other accounts on prem are "Office 365".
Is there a way to fix the missing "Office 365" account in exchange on prem?
attempted to add
[PS] C:\Windows\system32>Set-RemoteMailbox $USER -ExchangeGuid $GUIDHERE
The operation couldn't be performed because object '$USER' couldn't be found on 'AD1.DOMAIN.LOCAL'.
+ CategoryInfo : NotSpecified: (:) [Set-RemoteMailbox], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : [Server=EXCHANGE1,RequestId=c45a6d57-2c60-43d1-a36d-67bbbccc8bcf,TimeStamp=5/19/2020
10:19:41 PM] [FailureCategory=Cmdlet-ManagementObjectNotFoundException] 1082ECE3,Microsoft.Exchange.Management.Rec
ipientTasks.SetRemoteMailbox
+ PSComputerName : EXCHANGE1.DOMAIN.LOCAL
First we need to confirm what the issue is. You create the new account in local AD, now, this issue is:
1.There is no account in Office 365--- “this user it looks like the user was created in Active Directory First, then the AD Sync synced the account to Office 365.“ this is as expected. You could force a synchronization from AD to Azure AD PowerShell is used.
To perform a delta synchronization run: Start-ADSyncSyncCycle -PolicyType Delta
To perform a full synchronization use: Start-ADSyncSyncCycle -PolicyType Initial
2.There is no mailbox in Office 365--- The correct way is to enable remote mailbox for the user
Enable-remotemailbox -identity “Demo User”-remoteroutingaddress [email protected].
The proxy address will always be @tenant.mail.onmicrosoft.com Then assign the license.
3.There is no remote mailbox on Exchange on-premise--- If a Remote Mailbox isn’t present or has been accidentally deleted, you can create one and link it up to the Office 365 mailbox. To do this:
From Exchange Management Shell (On Premise):
Enable-RemoteMailbox username –RemoteRoutingAddress [email protected]
You then need to get the Mailbox GUID of the Office 365 mailbox. To do this, go into Office 365 PowerShell and run:
Get-Mailbox –Identity emailaddress | fl Identity,ExchangeGUID
Copy the Mailbox GUID into your clipboard and go back to the Exchange Management Shell (On Premise):
Set-RemoteMailbox username –ExchangeGUID 8e992097-24c1-432c-8a89-98e3c7a7d283
refence: "MigrationPermanentException: Cannot find a recipient that has mailbox GUID " error message when you try to move a mailbox in an Exchange hybrid deployment https://support.microsoft.com/en-us/help/2956029/migrationpermanentexception-cannot-find-a-recipient-that-has-mailbox-g>
In this situation, you could remove it completely and recreate it as the supported way.
Get-MsolUser -ReturnDeletedUsers - | FL UserPrincipalName,ObjectID
Remove-MsolUser -ObjectId -RemoveFromRecycleBin -Force
Remove-Mailbox -Identity [email protected] -PermanentlyDelete
https://techcommunity.microsoft.com/t5/exchange-team-blog/office-365-message-attribution/ba-p/749143 https://social.technet.microsoft.com/Forums/en-US/f7821dd9-1b11-4344-a677-1fc0b642c168/how-to-rename-user-after-migrate-mailbox-to-cloub?forum=exchangesvrdeploy