{"id":612,"date":"2017-10-09T14:36:45","date_gmt":"2017-10-09T12:36:45","guid":{"rendered":"https:\/\/msb365.abstergo.ch\/?p=612"},"modified":"2023-06-23T13:12:55","modified_gmt":"2023-06-23T11:12:55","slug":"things-aware-migrating-exchange-online","status":"publish","type":"post","link":"https:\/\/www.msb365.blog\/?p=612","title":{"rendered":"Things to be aware of when migrating to Exchange Online"},"content":{"rendered":"<p>2018 is already knocking at the door and more and more of my customers find their way towards the cloud. On one hand to Office 365, but mostly towards Exchange Online.<\/p>\n<p>During the Ingnite 2017, besides the announcement of Exchange Server 2019, Microsoft finally approved the upcoming support for tenant to tenant migrations.<\/p>\n<p>This helps a lot of decision-makers to go for the cloud and migrate their infrastructure. This, because of the freedom to still be able to change and adjust things after the migration is done. From my point of view Microsoft is on the right path in doing so.<\/p>\n<p>But still one has to be aware that a migration to the cloud can lead to unexpected issues. I\u2019ll describe some little and a big show stopper for you here. Please mention the big one during your migrations!<\/p>\n<p>So far so good. Let\u2019s first start with the little show stoppers.<\/p>\n<p>&nbsp;<\/p>\n<h4>Little show stoppers<\/h4>\n<h5>Mailbox permissions<\/h5>\n<p>There are a lot of things to keep in mind when migrating to Exchange Online. One is the mailbox delegation and group\/shared mailbox ownership. It is not possible to have Send-As rights on an on-premises mailbox for a mailbox which was migrated to the cloud and vice versa!<\/p>\n<h5>SMTP address<\/h5>\n<p>Furthermore it might be possible, that a mailbox migration to Exchange Online just fails with an error:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-613\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/1-1.png\" alt=\"\" width=\"793\" height=\"82\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/1-1.png 793w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/1-1-600x62.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/1-1-300x31.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/1-1-768x79.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/1-1-780x81.png 780w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/p>\n<p>In most cases it\u2019s just a simple issue. While looking at the Exchange user object I noticed, that this user doesn\u2019t have an \u201c.onmicrosoft.com\u201d STMP address.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-616\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/2-1.png\" alt=\"\" width=\"450\" height=\"539\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/2-1.png 450w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/2-1-250x300.png 250w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/p>\n<p>So, what to do now? Very simple! Just go to \u2018Add\u2019 and create an additional SMTP address for that user with the \u2018.onmicrosoft.com\u2019 domain of your O365 tenant. Afterwards the migration will no longer fail.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-617\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/3-1.png\" alt=\"\" width=\"781\" height=\"81\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/3-1.png 781w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/3-1-600x62.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/3-1-300x31.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/3-1-768x80.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2017\/10\/3-1-780x81.png 780w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/p>\n<h4>Big show stopper &#8211; Exchange Web Services<\/h4>\n<p>A far bigger thing are 3<sup>rd<\/sup> party systems like ERP\u2019s and others which are accessing Exchange through the Exchange Web Services (EWS).<\/p>\n<h5>The challenge<\/h5>\n<p>There are two EWS paths. One internal and one external. The challenge here is that applications which are using EWS can whether access on-premises mailboxes (internal), <strong>or<\/strong> cloud mailboxes (external). And here comes the solution for this challenge.<\/p>\n<h5>The solution in steps<\/h5>\n<ol>\n<li>Tell your application to use the external EWS path<\/li>\n<li>Login to Exchange Online Admin Center<\/li>\n<li>Go to \u201cPermissions\u201d -&gt; \u201cAdmin roles\u201d<\/li>\n<li>Edit the role \u201cDiscovery Management\u201d<\/li>\n<li>Add the following permission to the role: \u201cApplicationImpersonation\u201d<\/li>\n<li>Add the (service) account, used by your application as a member of the role.<\/li>\n<\/ol>\n<h5><\/h5>\n<h5>The solution explained<\/h5>\n<p>Here\u2019s what we did and why we did it.<\/p>\n<p>First we added the \u201cApplicationImpersonation\u201d permission to the Discovery Management role. Members of the Discovery Management role group can perform searches of mailboxes in the Exchange organization for data that meets specific criteria and can also configure litigation holds on mailboxes. See <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/dd638105(v=exchg.150).aspx\">https:\/\/technet.microsoft.com\/en-us\/library\/dd638105(v=exchg.150).aspx<\/a><\/p>\n<p>The Application Impersonation permission is needed for the access through EWS using impersonation. Impersonation enables an account on an Exchange server to perform actions by using the permissions that are associated with another account. See <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/office\/dd633680(v=exchg.80).aspx\">https:\/\/msdn.microsoft.com\/en-us\/library\/office\/dd633680(v=exchg.80).aspx<\/a><\/p>\n<p>In the next step we just added the account used by the application to the Discovery Management role. By this it now can use impersonation through EWS and can also perform mailbox searches.<\/p>\n<h5>Test it<\/h5>\n<p>To test the mailbox access through EWS you can use the following PowerShell script. It\u2019s using the default EWS dll path from Exchange Web Services API 2.2 is installed. Change the path if needed.<\/p>\n<pre>#requires -RunAsAdministrator\r\n\r\n$EwsDll = 'C:\\Program Files\\Microsoft\\Exchange\\Web Services\\2.2\\Microsoft.Exchange.WebServices.dll' # Path to EWS dll\r\n\r\n$Username = 'User@Contoso.com' # migrated to Exchange Online - <strong>Service account, which is member of the role \u201cDiscovery Management\u201d<\/strong>\r\n\r\n$Password = 'Pa$$w0rd'\r\n\r\nAdd-Type -Path $EwsDll\r\n\r\n$Service = New-Object -TypeName Microsoft.Exchange.WebServices.Data.ExchangeService\r\n\r\n$Arguments = @($Username, $Password)\r\n\r\n$Creds = New-Object -TypeName Microsoft.Exchange.WebServices.Data.WebCredentials -ArgumentList $Arguments\r\n\r\n$Service.Credentials = $Creds\r\n\r\n$Service.TraceEnabled = $True\r\n\r\n# Autodiscover approach (RECOMMENDED):\r\n\r\n# $Service.AutodiscoverUrl( $Username, {$True} )\r\n\r\n# Hardcoding the EWS endpoint:\r\n\r\n$Service.Url = \"<a href=\"https:\/\/mail.Contoso.com\/EWS\/Exchange.asmx\">https:\/\/mail.Contoso.com\/EWS\/Exchange.asmx<\/a>\"\r\n\r\n$Service | Format-List\r\n\r\n# A connection is established and information from the mailbox can be gathered. For example, OOF settings:\r\n\r\n$SmtpAddress = 'User@Contoso.com' #On-premise mailbox, or Exchange Online mailbox\r\n\r\n$Service.GetUserOofSettings($SmtpAddress)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>2018 is already knocking at the door and more and more of my customers find their way towards the cloud. On one hand to Office 365, but mostly towards Exchange Online. During the Ingnite 2017, besides the announcement of Exchange Server 2019, Microsoft finally approved the upcoming support for tenant to tenant migrations. This helps [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1923,2,3],"tags":[],"class_list":["post-612","post","type-post","status-publish","format-standard","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\/612","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=612"}],"version-history":[{"count":14,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/612\/revisions"}],"predecessor-version":[{"id":638,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/612\/revisions\/638"}],"wp:attachment":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}