{"id":21450,"date":"2023-09-05T04:28:05","date_gmt":"2023-09-05T04:28:05","guid":{"rendered":"https:\/\/www.insentragroup.com\/nz\/?p=21450"},"modified":"2023-09-05T04:28:06","modified_gmt":"2023-09-05T04:28:06","slug":"how-to-match-an-exo-mailbox-to-an-ad-user-object","status":"publish","type":"post","link":"https:\/\/www.insentragroup.com\/nz\/insights\/geek-speak\/secure-workplace\/how-to-match-an-exo-mailbox-to-an-ad-user-object\/","title":{"rendered":"How to Match an Exo Mailbox to an Ad User Object"},"content":{"rendered":"\n<p>During a recent Tenant-To-Tenant (let\u2019s call it \u201cT-to-T\u201d 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.&nbsp;<\/p>\n\n\n\n<p>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.&nbsp;<\/p>\n\n\n\n<p>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!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<p>To implement this solution you need to be an Exchange Administrator on M365 and on-premises Exchange, and be comfortable with PowerShell.&nbsp;<\/p>\n\n\n\n<p>The first requirement is to get the ExchangeGuid from the user\u2019s EXO mailbox using PowerShell&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Within PowerShell, connect to Exchange Online Management&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Import-Module ExchangeOnlineManagement&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect-ExchangeOnline&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Once this has successfully connected (hopefully you will have been prompted for MFA!), run the following to get the ExchangeGuid for the associated user&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Get-Mailbox &#8220;<a href=\"mailto:Joe.Bloggs@whatever.com\" target=\"_blank\" rel=\"noreferrer noopener\">Joe.Bloggs@whatever.com<\/a>&#8221; | fl UserPrincipalName,DisplayName,EmailAddresses,ExchangeGuid&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Then, open a PowerShell session for Exchange on-premises and run the following&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable-RemoteMailbox \u201cJoe.Bloggs@whatever.com\u201d -RemoteRoutingAddress \u201cjoe.bloggs@&lt;tenant name&gt;.mail.onmicrosoft.com\u201d&nbsp;<\/li>\n\n\n\n<li>Set-RemoteMailbox \u201cJoe.Bloggs@whatever.com\u201d -ExchangeGuid &#8220;&lt;Exchange GUID from EXO&gt;&#8221;&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Once this has completed, let Azure AD Connect sync, or manually run a sync &#8211; <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/itops-talk-blog\/powershell-basics-how-to-force-azuread-connect-to-sync\/ba-p\/887043\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">PowerShell Basics: How to Force AzureAD Connect to Sync (microsoft.com)<\/a>&nbsp;<\/p>\n\n\n\n<p>Check the attributes have successfully updated, and the user account can now be managed within Exchange Hybrid.&nbsp;&nbsp;<\/p>\n\n\n\n<p>That\u2019s 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.&nbsp;&nbsp;<\/p>\n\n\n\n<p>If you want to know any further information around Exchange and how Insentra can help, our <a href=\"https:\/\/www.insentragroup.com\/nz?s=exchange\" target=\"_blank\" rel=\"noreferrer noopener\">Insentra Exchange Blogs<\/a> may be exactly what you are looking for!\u00a0\u00a0<\/p>\n\n\n\n<p>Hopefully this has been informative and helpful! If you need any further clarification, or a no thrills chat, <a href=\"https:\/\/www.insentragroup.com\/nz\/contact\/\" target=\"_blank\" rel=\"noreferrer noopener\">contact us<\/a> at Insentra or read more of my <a href=\"https:\/\/www.insentragroup.com\/nz\/insights\/insights-search-results\/?author=Dan%20Snape\" target=\"_blank\" rel=\"noreferrer noopener\">Insentra Insights<\/a>.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to match Exchange Online (EXO) mailboxes to on-premises AD user objects in a Tenant-To-Tenant (T-to-T) migration project. Follow our step-by-step solution for successful mailbox linkage. <\/p>\n","protected":false},"author":90,"featured_media":21460,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[20],"tags":[],"class_list":["post-21450","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-secure-workplace","entry"],"_links":{"self":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts\/21450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/users\/90"}],"replies":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/comments?post=21450"}],"version-history":[{"count":1,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts\/21450\/revisions"}],"predecessor-version":[{"id":21461,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/posts\/21450\/revisions\/21461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/media\/21460"}],"wp:attachment":[{"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/media?parent=21450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/categories?post=21450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.insentragroup.com\/nz\/wp-json\/wp\/v2\/tags?post=21450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}