{"id":866,"date":"2017-12-12T11:58:09","date_gmt":"2017-12-12T09:58:09","guid":{"rendered":"https:\/\/msb365.abstergo.ch\/?p=866"},"modified":"2023-06-23T13:13:29","modified_gmt":"2023-06-23T11:13:29","slug":"merge-exchange-online-mailbox-premise-ad-account","status":"publish","type":"post","link":"https:\/\/www.msb365.blog\/?p=866","title":{"rendered":"Merge Exchange online Mailbox with on-premise AD account"},"content":{"rendered":"<p>One of my customer runs a hybrid exchange environment. By the onboarding process of new employees he needs to create the AD user and Mailbox onpremise.<\/p>\n<p>After creating the Mailbox and if is needed (depends on Company Police) the Customer moves the Mailbox to the exchange online.<\/p>\n<p>Here it is important to be sure that the right routing address is set and all works fine.<\/p>\n<p>If you wanna know more about the Routing address, you can find my article about it <a href=\"https:\/\/msb365.abstergo.ch\/?p=639\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>here<\/strong><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>In this Case for some reason, one of the Mailboxes was created wrong. That means,\u00a0 the Mailbox was created directly in the Cloud.<\/p>\n<p>Here that means that there was a User AD Object on premise but no Mailuser.<\/p>\n<p>When the User was sending Mails (across the Cloud) he was able to send it with his Maildomain address.<\/p>\n<p>But if someone tried to send him or answer him to his Mailaddress, he got the following Note:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-867\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/0.png\" alt=\"\" width=\"566\" height=\"626\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/0.png 833w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/0-600x664.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/0-271x300.png 271w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/0-768x850.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/0-780x863.png 780w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/p>\n<p>This happened because there is no Mailuser on the onpremise side Exchange. The Exchange means that this Mail address don&#8217;t exists and refuse it to accept.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>How to fix this issue?<\/strong><\/p>\n<p>EASYLY&#8230;<\/p>\n<p>First we open a remote PowerShell connection to the Office 365 Tenant\u00a0and run the following cmdlet:<\/p>\n<pre>Get-Mailbox user | fl ExchangeGUID<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-868\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/3.png\" alt=\"\" width=\"503\" height=\"90\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/3.png 503w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/3-300x54.png 300w\" sizes=\"(max-width: 503px) 100vw, 503px\" \/><\/p>\n<p>We copy the displayed GUID of the Exchange online Mailbox.<\/p>\n<p>Now we have to go to the onpremise Exchange and start the Exchange Management Shell. There we run the following cmdlet:<\/p>\n<pre>Enable-RemoteMailbox user -RemoteRoutingAddress user@domain.mail.onmicrosoft.com<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-869\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/1.png\" alt=\"\" width=\"925\" height=\"62\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/1.png 925w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/1-600x40.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/1-300x20.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/1-768x51.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/1-780x52.png 780w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/><\/p>\n<p>Now we are able to see in the Exchange Console under <span style=\"color: #0000ff;\"><em>Recipient Configuration &gt; Mail Contact<\/em><\/span> the enabled Mailuser.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-871\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/2.png\" alt=\"\" width=\"362\" height=\"205\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/2.png 362w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/2-300x170.png 300w\" sizes=\"(max-width: 362px) 100vw, 362px\" \/><\/p>\n<p>The next step, we need to change the GUID for the enabled Mailuser. The one we copied earlier today.<\/p>\n<p>For that you simply run on the onpremise Exchange management shell the following cmdlet:<\/p>\n<pre>Set-RemoteMailbox user -ExchangeGUID &lt;the ExchangeGUID you copied above&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-872\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/4.png\" alt=\"\" width=\"553\" height=\"66\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/4.png 553w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/4-300x36.png 300w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>So what we did?<\/strong><\/p>\n<p>First cmdlet will create a mail-enabled object in Exchange on-prem and configure the target Address for remote routing and coexistence.<\/p>\n<p>Second cmdlet sets the on-prem ExchangeGuid so it matches Office 365.<\/p>\n<p>This will allow you to move the mailbox from Office 365 to on-prem (offboarding), if you ever want or need to do that.<\/p>\n<p>As the last step is, we start a AD Sync on the AAD Connect server with the following cmdlet:<\/p>\n<pre>Start-ADSyncSyncCycle -PolicyType Delta<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-873\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/5.png\" alt=\"\" width=\"443\" height=\"83\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/5.png 443w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/12\/5-300x56.png 300w\" sizes=\"(max-width: 443px) 100vw, 443px\" \/><\/p>\n<p>When sync is successfully done, Mailbox will work as expected.<\/p>\n<p>I hope this solution will help you to fix this kind of issues, it is more smoother than to delete the Mailbox and recreate it.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Photo by\u00a0<a href=\"https:\/\/unsplash.com\/photos\/tmFBmZgMkgo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Jonathan Borba<\/a>\u00a0on\u00a0<a href=\"https:\/\/unsplash.com\/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Unsplash<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of my customer runs a hybrid exchange environment. By the onboarding process of new employees he needs to create the AD user and Mailbox onpremise. After creating the Mailbox and if is needed (depends on Company Police) the Customer moves the Mailbox to the exchange online. Here it is important to be sure that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1923,2,3],"tags":[],"class_list":["post-866","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-365","category-exchange","category-powershell"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=866"}],"version-history":[{"count":6,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/866\/revisions"}],"predecessor-version":[{"id":5208,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/866\/revisions\/5208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/media\/3415"}],"wp:attachment":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}