<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hamza Hassoun on Medium]]></title>
        <description><![CDATA[Stories by Hamza Hassoun on Medium]]></description>
        <link>https://medium.com/@hamza.hassoun?source=rss-d08a9b0d0d41------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fBbytPjtUTfeLnzx_6wd5A.jpeg</url>
            <title>Stories by Hamza Hassoun on Medium</title>
            <link>https://medium.com/@hamza.hassoun?source=rss-d08a9b0d0d41------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:30:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hamza.hassoun/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Migrating existing domains between two Office 365 tenants.]]></title>
            <link>https://medium.com/@hamza.hassoun/migrating-existing-domains-between-two-office-365-tenants-2b5ba6ef2a66?source=rss-d08a9b0d0d41------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b5ba6ef2a66</guid>
            <category><![CDATA[office-365]]></category>
            <category><![CDATA[exchange]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Hamza Hassoun]]></dc:creator>
            <pubDate>Mon, 04 Dec 2017 16:15:05 GMT</pubDate>
            <atom:updated>2017-12-04T16:56:18.358Z</atom:updated>
            <content:encoded><![CDATA[<p>Picking an Office 365 tenant name is a one-time opportunity, similarly to picking the Office 365 region that will host your Office 365 tenant. Neither the tenant name or the tenant region can be changed after they have been selected. However, in some cases, companies and organizations see the need to either change their tenant name or their region and are confronted with the inability to do so. The only possible course of action is to migrate all the existing Office 365 services to the new tenant.</p><p>If there is no need to retain the data in the old tenant, you can easily remove all users and your verified domains from the old tenant. However, when the intent is to move the domains to the new tenant while keeping all the data in the old tenant, removing all users from the old tenant is no longer an option. The methodology and scripts to be used in this particular scenario follow:</p><p><strong><em>Warning : </em></strong><em>This will guide you through the process of moving domains between tenants. This guide only covers the Identity and Authentication components. Once the process is started, users will be unable to login to the old Office 365 tenant and Exchange Online mail flow will be interrupted. You will have to migrate all existing services (Exchange Online, SharePoint, Skype for Business, etc.) to the new tenant and move your existing licences.</em></p><p><strong>Step 1 : Disable ADFS Federation</strong></p><p>This step only applies to tenants with one or more domains using identity federation. You must revert all federated domains to managed domains.</p><p>You will first need to connect to your Office 365 tenant using the Powershell command Connect-MsolService . You can verify which domains in your tenant are <em>Federated</em> by running theGet-MsolDomain command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*Bws7uDqBo-ofXmuVnRBYZw.jpeg" /></figure><p>Set the ADFS context to the name of your server. This is the actual FQDN of the ADFS server.</p><pre>Set-MsolADFSContext -Computer <strong>ADFS_Server_FQDN</strong></pre><p>You can then convert each one of your federated domains to a managed domain. The user conversion can be skipped as it will not be required and will significantly decrease the amount of time required to run the command:</p><pre>Convert-MsolDomainToStandard -DomainName <strong>labhh.com </strong>-SkipUserConversion:$true -PasswordFile <strong>C:\passwords.txt</strong></pre><p>If the command completes successfully, all your domains should be listed as <em>Managed</em>. At this point, users will no longer be able to login with their credentials if Password Synchronization is not enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*GiSPXJyStMGy5hxh7BlNbA.jpeg" /></figure><p><strong>Step 2 : Disable Azure Active Directory Connect synchronization</strong></p><p>Once all domains are <em>Managed</em> domains, it is time to disable the directory synchronization. You will need to run the following command using Powershell to turn it off:</p><pre>Set-MsolDirSyncEnabled -EnableDirSync $false</pre><p>You can then turn off the directory synchronization server or uninstall Azure AD Connect.</p><p><strong>Step 3 : Change all UPNs to the .onmicrosoft.com domain</strong></p><p>Once the identity synchronization is disabled, all your existing users should revert back to In Cloud users. If you log back in to the tenant, the “Status” column should have disappeared entirely. However, all attributes are left unchanged including UPNs and email addresses.</p><p>To remove your domain from the Office 365, you must make sure the domain is no longer used in any of your users’ attributes. Depending on how large your organization is, it might take a significant amount of time to clean up all users.</p><p>Start by changing all your users’ UPN to the .onmicrosoft.com domain by running the following script:</p><pre>Get-MsolUser -All | foreach {Set-MsolUserPrincipalName -ObjectId $_.ObjectId -NewUserPrincipalName ($_.UserPrincipalName.Split(“@”)[0] + “@<strong>labhh.onmicrosoft.com</strong>”)}</pre><p>If you have distribution groups, you will also need to update their primary SMTP address. Login to your <a href="https://technet.microsoft.com/en-us/library/jj984289%28v=exchg.160%29.aspx?f=255&amp;MSPPError=-2147217396">Exchange Online Powershell</a> and run the following commands:</p><pre>Get-DistributionGroup -ResultSize Unlimited | ForEach {Set-DistributionGroup -Identity $_.Name -primarysmtpaddress ($_.primarysmtpaddress.Split(“@”)[0] + “@<strong>labhh.onmicrosoft.com</strong>”)}</pre><p><strong>Step 4 : Remove any dependency</strong></p><p>Once all users have their UPN set to the .onmicrosoft.com domain, you will need to remove any email address using one of your domains. You will have to perform this cleanup on users, groups, and resources (room and equipment).</p><p>In order to find all users who have an email address matching the domain you are moving, run the following command. This will output the UPN of every user that has a dependency to the domain.</p><pre>Get-MsolUser -DomainName <strong>labhh.com</strong> -all</pre><p>Because we changed every user’s UPN, their primary SMTP addresses are now also on the .onmicrosoft.com domain. Therefore, all remaining addresses on the domain are secondary email addresses. You can remove all aliases from every user mailbox using this script:</p><pre>$users =  Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Where {$_.Emailaddresses.count -gt 1}<br>$i=0<br>foreach ($user in $users) {<br> foreach ($email in $user.emailaddresses){<br>  if ($email -ne &quot;SMTP:&quot;+$user.PrimarySmtpAddress){<br>   Set-Mailbox -Identity $user.name -EmailAddresses @{Remove=$email}<br>  }<br> }<br> $i++<br> Write-host $user.primarysmtpaddress &quot;has been processed&quot; $i&quot;/&quot;$users.count<br>}</pre><p>You can then remove all aliases from every distribution group using the following script:</p><pre>$groups =  Get-DistributionGroup -ResultSize Unlimited | Where {$_.Emailaddresses.count -gt 1}<br>$i=0<br>foreach ($group in $groupss) {<br> foreach ($email in $group.emailaddresses){<br>  if ($email -ne &quot;SMTP:&quot;+$group.PrimarySmtpAddress){<br>   Set-DistributionGroup -Identity $group.name -EmailAddresses @{Remove=$email}<br>  }<br> }<br> $i++<br> Write-host $group.primarysmtpaddress &quot;has been processed&quot; $i&quot;/&quot;$groups.count<br>}</pre><p>Now that all dependencies have been removed, you can safely remove verified domains from your Office 365 tenant and add them to the new one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b5ba6ef2a66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unable to configure Hybrid with Exchange 2016 CU7.]]></title>
            <link>https://medium.com/@hamza.hassoun/unable-to-configure-hybrid-with-exchange-2016-cu7-850a659a1780?source=rss-d08a9b0d0d41------2</link>
            <guid isPermaLink="false">https://medium.com/p/850a659a1780</guid>
            <category><![CDATA[erros]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[exchange]]></category>
            <category><![CDATA[hybrid]]></category>
            <category><![CDATA[office-365]]></category>
            <dc:creator><![CDATA[Hamza Hassoun]]></dc:creator>
            <pubDate>Mon, 27 Nov 2017 01:45:29 GMT</pubDate>
            <atom:updated>2017-11-27T04:08:41.362Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Cloud System Engineer, I often find myself helping clients getting their Exchange Organization set up in hybrid mode with Exchange Online. Since the Cumulative Update 7 for Exchange Server 2016 was released a month ago, I have noticed a recurring issue that has prevented a few of my clients from successfully running the Hybrid Wizard.</p><p>The scenario is as follows: you download and execute the Hybrid Wizard, which successfully connects to Office 365 and the local Exchange Organization. During the configuration process, the wizard will request you to add a DNS TXT to verify you own the domain. This is where you’ll hit a snag. Even after successfully adding the DNS record, the wizard will display the message Adding Federated Domain… and hang indefinitely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*QcFWGRBJ4Knm70Cfzvg6Jw.jpeg" /></figure><p>The only way to get more information is by consulting the Hybrid Wizard log, but you are still presented with a very generic error.</p><pre><em>2017.10.16 16:19:06.905 *ERROR* 10277 [Client=UX, Activity=Domain Ownership, Session=OnPremises, Cmdlet=Set-FederatedOrganizationIdentifier, Thread=7] FINISH Time=3489.0ms Results=PowerShell failed to invoke ‘</em><strong><em>Set-FederatedOrganizationIdentifier’: Object reference not set to an instance of an object.</em></strong><em> An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object.</em></pre><p>Attempting to run the Set-FederatedOrganizationIdentifier<strong><em> </em></strong>powershell command or attempting to enable the Federation Trust through the Exchange Admin console will result in the same generic error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*WYUIROAzzG-JhZelcE7sXQ.jpeg" /></figure><p>This is a known issue of the CU7 for Exchange 2016 and the issue is very simple to solve. You must create a new file named SystemConfigurationTasks.Overrides.ini and save it to the Exchange config folder C:\Program Files\Microsoft\Exchange Server\V15\Config\</p><p>The content of the file must be as follows:</p><pre>[SystemConfigurationTasks.settings.ini:FederationTrustFromCache]<br>Enabled=False</pre><p>Once the file is created, you can either manually complete the Federation Trust setup through the Exchange Admin Center or run the Hybrid Wizard again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=850a659a1780" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>