0

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
confoundr
  • 347
  • 3
  • 8
  • 18

2 Answers2

1

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 demo.user@agileit.mail.onmicrosoft.com.

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 alias@domain.mail.onmicrosoft.com

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>

Jayce
  • 769
  • 4
  • 5
  • It seems like I'm somewhat scenario 3 here, but when I go to add set the mailbox to the remote mailbox I get an error stating that the AD account doesnt exist. When I check AD the user does exist. – confoundr May 19 '20 at 22:36
  • 1
    `Disable-Mailbox ` was the missing piece. After I ran `Disable-Mailbox ` the cmdlet for `Enable-RemoteMailbox -RemoteRoutingAddress ` worked like a charm. – confoundr Jun 01 '20 at 23:05
0

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 user@domain.com -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

Jayce
  • 769
  • 4
  • 5
  • I assume this would delete all of the data on the existing user account that is currently in the Cloud. The user has about 8GB of data already-- the user account is for an active user that's been with us a couple years. – confoundr May 21 '20 at 22:49
  • export the date to pst file first. – Jayce May 25 '20 at 05:59