How to Match an Exo Mailbox to an Ad User Object

New Zealand | How to Match an Exo Mailbox to an Ad User Object

During a recent Tenant-To-Tenant (let’s call it “T-to-T” shall we!) migration project, the source environment we were presented with had no on-premises Exchange infrastructure, while the target environment had an Exchange hybrid configuration in place. The source mailboxes had already been provisioned in the target Exchange Online (EXO) environment, but we had an issue emailing these users due to the configuration of mail hygiene solution. 

To resolve the issue we needed to link the EXO mailboxes to their on-premises AD User object. The users were already matched from an identity perspective using Azure AD Connect, but their Exchange attributes needed to be matched too. 

To do this we needed to get the EXO GUID for each user and inject it into the on-premises AD user object attributes. I have listed the solution below which will hopefully help you too!

Solution

To implement this solution you need to be an Exchange Administrator on M365 and on-premises Exchange, and be comfortable with PowerShell. 

The first requirement is to get the ExchangeGuid from the user’s EXO mailbox using PowerShell 

  • Within PowerShell, connect to Exchange Online Management 
  • Import-Module ExchangeOnlineManagement 
  • Connect-ExchangeOnline 

Once this has successfully connected (hopefully you will have been prompted for MFA!), run the following to get the ExchangeGuid for the associated user 

Then, open a PowerShell session for Exchange on-premises and run the following 

  • Enable-RemoteMailbox “Joe.Bloggs@whatever.com” -RemoteRoutingAddress “joe.bloggs@<tenant name>.mail.onmicrosoft.com” 
  • Set-RemoteMailbox “Joe.Bloggs@whatever.com” -ExchangeGuid “<Exchange GUID from EXO>” 

Once this has completed, let Azure AD Connect sync, or manually run a sync – PowerShell Basics: How to Force AzureAD Connect to Sync (microsoft.com) 

Check the attributes have successfully updated, and the user account can now be managed within Exchange Hybrid.  

That’s it! You should be good to go now. You can also modify this script to import a list if you have multiple users to fix.  

If you want to know any further information around Exchange and how Insentra can help, our Insentra Exchange Blogs may be exactly what you are looking for!  

Hopefully this has been informative and helpful! If you need any further clarification, or a no thrills chat, contact us at Insentra or read more of my Insentra Insights

Join the Insentra Community with the Insentragram Newsletter

Hungry for more?

If you’re waiting for a sign, this is it.

We’re a certified amazing place to work, with an incredible team and fascinating projects – and we’re ready for you to join us! Go through our simple application process. Once you’re done, we will be in touch shortly!

New Zealand | How to Match an Exo Mailbox to an Ad User Object

Unleashing the power of Microsoft Copilot

This comprehensive guide provides everything you need to get your organisation ready for and successfully deploy Copilot.

Who is Insentra?

Imagine a business which exists to help IT Partners & Vendors grow and thrive.

Insentra is a 100% channel business. This means we provide a range of Advisory, Professional and Managed IT services exclusively for and through our Partners.

Our #PartnerObsessed business model achieves powerful results for our Partners and their Clients with our crew’s deep expertise and specialised knowledge.

We love what we do and are driven by a relentless determination to deliver exceptional service excellence.

New Zealand | How to Match an Exo Mailbox to an Ad User Object

Insentra ISO 27001:2013 Certification

SYDNEY, WEDNESDAY 20TH APRIL 2022 – We are proud to announce that Insentra has achieved the  ISO 27001 Certification.