In this post I want to go through all necessary steps to migrate Exchange and Skype for Business onPrem to Office 365 resp. Exchange Online and Teams including SIP Trunk for PSTN calling and conferencing.

This post is split into multiple parts due to the complexitiy of a migration from Exchange and Skype for Business onPremise to Office 365 resp. Exchange Online and Teams.

Part 1 will cover the prerequisites like synchronize your onPrem users to Office 365 with Azure AD Connect.

Part 2 will cover migration from Exchange onPrem to Exchange Online and here especially Exchange Hybrid classic full.

Part 3 will cover moving user mailboxes from onPrem to Exchange Online.

Part 4 … will cover troubleshooting Exchange Hybrid

Part 5 will cover migration from Skype for Business onPrem users to Skype for Business Online and Teams.

Part 6 coming soon … will cover routing your onPrem SIP Trunk to Teams.

Before you migrate users to Office 365, be sure your onPremise environment is running without problems.

First Step is to configure the synchronization from our onPrem Active Directory to Office 365 resp. Azure Active Directory. Office 365 uses an Azure Active Directory in the background to manage the identities.

So If you create a new Office 365 Tenant, you will also get an Azure Active Directory on top.

Add your onPrem Active Directory Domain to your Office 365 Tenant. In my case this is, further I added which is the default email and sip domain of my onPrem Lab environment.

In case you use for your onPrem Domain a non-routable domain like contoso.local, AD Connect will synchronize this domain to an domain and the users UPN will be like

If you currently use a .local domain for your user accounts in Active Directory Domain Services (AD DS) it’s recommended that you change them to use a verified domain (like in order to properly sync with your Microsoft 365 domain.

Prepare a non-routable domain for directory synchronization

Checking onPrem Active Directory

Before we install AD Connect, first install IdFix to identify errors such as duplicates and formatting problems in your directory before you synchronize to Azure AD and Office 365.

The easiest way to get IdFix up and running is to download it onto a computer that is joined to your AD DS domain. You can run it on the domain controller if you want, but it’s not necessary.

Choose Query

After IdFix completes the query, you can synchronize your directory if there are no errors. If there are errors in your directory, it is recommended that you fix them before you synchronize. See prepare directory attributes for synchronization with Microsoft 365 for more information.

While it is not mandatory to fix the errors before you synchronize, we strongly recommend that you at least review all the errors returned by IdFix.

Installation of Azure AD Connect

Prerequisites for Azure AD Connect

By default a SQL Server 2012 Express LocalDB (a light version of SQL Server Express) is installed. SQL Server Express has a 10GB size limit that enables you to manage approximately 100,000 objects. If you need to manage a higher volume of directory objects, you need to point the installation wizard to a different installation of SQL Server. The type of SQL Server installation can impact the performance of Azure AD Connect.

Download the latest version of Azure AD Connect

As you can read in the above prerequisites for Azure AD Connect, the server on which you install Azure AD Connect, must be treated as a Tier 0 component as documented in the Active Directory administrative tier model

So it’s important that administrative access to this server is properly secured.

Regarding this requirements and for simple disaster recovery reasons, I would recommend to use a dedicated Virtual Machine to install Azure AD Connect.

In my case I use a dedicated Windows Server 2019 Virtual Machine.

So let’s install Azure AD Connect on this VM.

Click on Customize if you want change the default installation or want to use an existing SQL Server Instance instead a new SQL Express Installation. As mentioned above with the SQL Express Edition you are limited to manage 100.000 objects from your Active Directory which will be enough for the most installations.

Custom installation of Azure AD Connect

I will use here an SQL Server 2019 for this Installation and so selected the custom installation of Azure AD Connect.

For the Sign On method I will use Password hash synchronization so users can sign into Azure with their existing onPrem user credentials and you do not need to deploy any additional SSO infrastructure.

Further I checked Enable single sign-on.

The option will be available for selection only if the Sign On method is Password Hash Synchronization or Pass-through Authentication.

Azure Active Directory Seamless Single Sign-On: Quickstart

Azure Active Directory (Azure AD) Seamless Single Sign-On (Seamless SSO) automatically signs in users when they are on their corporate desktops that are connected to your corporate network. Seamless SSO provides your users with easy access to your cloud-based applications without needing any additional on-premises components.

The Azure AD global administrator is your Office 365 Administrator user account which you must enter here.

Click on Add Directory

Enter your Enterprise Admin credentials, it is recommended to select the Create new AD account.

To be able to sign-in into Office 365 (Azure AD) with your existing onPremise credentials, you need a verified Azure AD Domain which is the same as your onPremise domain.

If you have here listed some Not Added domains, check Continue without matching all UPN suffixes to verified domains.

To specify OUs to synchronize, choose Sync selected domains and OUs option and specify required OUs.

As you can see, I don’t check the Domain Admins OU. I don’t want to synchronize domain admins to Office 365, apart from that, this OU only contains the Built-in Administrator account which is a critical system object and won’t synchronize to Azure AD even if it is checked!

One or more objects don’t sync when using Azure Active Directory Sync tool

Specify how users should be identified in the on-premises directories then click Next.

Select Synchronize all users and devices and click Next.

Check your optional features

To enable single sign-on, click Enter credentials and specify the Domain Admin credentials.

Click on next and then at the dialog at Ready to configure check that Start the synchronization process … is checked and click on Install.

Leave Enable staging mode blank as we want an active Azure AD Connect server.

Regarding staging mode read also my post

Azure AD Connect: Staging server and disaster recovery

With a server in staging mode, you can make changes to the configuration and preview the changes before you make the server active. It also allows you to run full import and full synchronization to verify that all changes are expected before you make these changes into your production environment.

Staging mode can be used for several scenarios, including:

  • High availability.
  • Test and deploy new configuration changes.
  • Introduce a new server and decommission the old.

Now the initial synchronization process is started and your selected onPrem users will be synchonized to Office 365 resp. Azure AD which Office 365 is using for user management.

In order to setup the migration from Exchange onPrem to Exchange Online, we need to adjust some settings in Azure AD Connect.

So open Aure AD Connect again and click on Configure

Click on Customize synchronization options

Login with your Azure AD global administrator which is your Office 365 Administrator user account.

If you want to change which users you want to synchronize to Office 365 and Azure AD, you can change it here. But for now, we want to enable Exchange hybrid deployment, so click on Next.

Check Exchange hybrid deployment and for later Directory extension attribut sync. The Password hash synchronization we already had configured.

For now leave this blank, we will come later to configure specific addtitional Directory extensions. Azure AD Connect use nevertheless some mandatory default extensions.

Click on Configure to synchronize the changes to Office 365 and Azure AD.

After finishing the installation and configuration of Azure AD Connect, the question is, do we migrate Exchange or Skype for Business first to Office 365?

Both constellations are supported, but if you anyway want to migrate both to Office 365, best practices is to move first the users mailbox and then the Skype for Business home.

The other way, a user is at Skype for Business online and his mailbox is on Exchange onPrem, have some limitations.

Below some informations about Exchange onPrem with Skype for Business online.

Skype for Business Online Coexistence with Exchange On-Premises

Exchange Server 2016/2013/2010 on-premises and a pure Skype for Business Online is supported with the right configuration. This Microsoft Support article is not well advertised but is a good reference on how to support this scenario:

How to integrate Exchange Server 2013 with Lync Server 2013, Skype for Business Online, or a Lync Server 2013 hybrid deployment.

More details on co-existence with Exchange Server, support criteria, and limitations in various combinations of on-premises and online are detailed in this TechNet article: Plan to integrate Skype for Business and Exchange.

Note, this article highlights a best practice, which is to move the user’s mailbox to Exchange Online before moving the user’s Skype for Business home. In practice, I have not found anything detrimental to moving the Skype for Business user first; aside from the feature limitations discussed here.

In Part 2 we first migrate our Exchange onPrem Mailboxes to Office 365 and Exchange Online …