< All Topics
Print

Azure AD Connect: Install and Setup Guide

Requirements for Microsoft Entra Connect

There are several requirements for using Azure AD Connect, and I have summarized them below.

  1. You need a Microsoft Entra tenant.
  2. Your on-premises AD domain needs to have a routable domain, or the user accounts need a registered UPN suffix that matches the verified domain in your tenant. For example, if your on-premises domain is .local then you have a problem. This is not a routable domain and will be different from your registered Entra tenant.
  3. Must be installed on a domain joined server that runs Windows Server 2022, 2019 or 2016.
  4. The Active Directory schema version and forest functional level must be Windows Server 2003 or higher.
  5. The domain controller used by the Entra connect must be writable.
  6. Windows Server full GUI
  7. You will need your Microsoft Entra Global Administrator account during the installation.

Refer to the Microsoft Prerequisites document for more details.

Download Microsoft Entra Connect

The Microsoft Entra Connect tool is only available from the Admin Center.

Step 1. Sign in to the Microsoft Entra admin center

Step 2. Expand Entra ID and then Entra Connect

click entra connect

Step 3. Click on “Connect Sync” and “Download the latest Entra Connect Sync Version”. This will download the AzureADConnect.msi install file.

download entra connect sync

Step 4. Click on Accept terms & download

The .msi file (AzureADConnect.msi) should then automatically download.

Install and configure Microsoft Entra Connect

Step 1. Run the AzureADConnect.msi file

Step 2. Agree to the license terms and click “Continue”.

Step 3. Click on “Customize” for the custom install. This will give you more options and allow you to choose the best options.

click customize

Refer to the Select your installation type document for more details.

Step 4. On the Install required components screen, make your selection and click “Install”. In most cases you will not need to select anything on this screen.

install required components

Step 5. On the User sign-in screen, select your sign on method and click “Next”. In most cases Password Hash Synchronization is used.

user sign in

Step 6. Enter your Entra ID account that has global administrator role and click “Next”.

connect to Microsoft id

You will be prompted to sign in with your Microsoft account.

Step 7. On the Connect your directories screen, under FORESTselect your directory and click “Add Directory”.

connect your directories

Step 8. Select “Create new AD account” and fill in the box with an account that has enterprise admin permissions. Then click “OK”.

create new ad account

By default, the install creates an account in your on-premises Active Directory named:

MSOL_<random characters>

The account is placed in the Users container by default (not in an OU). Here is a screenshot of the account that was created in my AD.

Configured Directories should now be listed. Click “next”.

configured directories

Step 9. The Microsoft Entra Sign-in Configuration screen.

This screen is very important! To sign-in to Office 365 with the same credentials as your on-premises AD, a matching Microsoft Entra ID domain is required. Your on-premises AD should have a UPN suffix that is also a verified domain in Entra. Typically, the on-premises userPrincipalName attribute is used as the Microsoft Entra ID username.

Select “Continue without matching all UPN suffixes to verified domains” and click “Next”.

You will have suffixes in your on-premises AD that do not need verified such as a subdomain or a .local domain. You can see in my screenshot below I have a verified domain “activedirectorypro.com” and one that is not verified.

microsoft entra sign in configuration

Step 10. On the Domain and OU filtering screen choose to sync all domains and OUs or choose to select specific domains and OUs. I have a lot of test accounts in my domain so I will choose to select specific OUs. You can always go back and change the filtering options.

domain and ou filtering

Step 11. On the Uniquely identify your users screen, select how users should be identified in your on-premises directories and select how users should be identified with Microsoft Entra ID. Click Next.

I’m leaving the default options selected.

identifying users

Step 12. On the Filter users and devices screen select your option and click Next. The default selection (Synchronize all users and devices) is recommended unless you are testing or creating a pilot deployment.

filter users and devices

Step 13. On the Optional features screen select your options and click “Next”. I’m leaving the default; you can come back later and add options as needed.

optional install features

Step 14. Select “Start the synchronization process when configuration completes”. Click “Install”.

click install

The installation can take several minutes to complete.

configuration complete

If you get a message that says “The Active Directory Recycle Bin is not enabled for your forest” then I highly recommend you enable it. See my article enable ad recycle bin for step by step instructions.

How to Check Entra Connect Sync Status

You can view the sync status by logging into the Microsoft Entra admin center, click on “Entra Connect” in the side bar menu and then click on “Connect Sync.

check entra status

Check Entra Connect Sync Status with PowerShell

On the server that has the Entra Connect sync tool installed you can run the following command.

Note: this command will not work in PowerShell 7.

Get-ADSyncScheduler

Exclude Users from Azure AD Connect Sync

What if you have users or groups that you don’t want to sync to the Azure cloud?

The easiest option is to use the Azure AD connect domain and OU filtering. If you need more advanced options such as excluding users based on an attribute you can use the synchronization rules editor.

The following steps will walk through excluding an OU from syncing.

1. Open Azure AD Connect.

azure ad connect icon

2. Click Configure

3. Click Customize synchronization options and click next

customize options

4. Enter your Azure AD global administrator credentials.

5. Select your forest, it should already be selected, and click next.

connect your directories

6. Select “Sync selected domains and OUs”.

Next, uncheck any domains or OUs you want to exclude from syncing to Azure.

In this example, I’m going to uncheck my west.ad.activedirectorypro.com domain. This domain was for testing only and does not need to be synced. Under my ad.activedirectorypro.com domain I’m going to uncheck my test OUs. These OUs are test accounts that do not need to be synced.

azure ad connect ou filtering
excluded ous from syncing

When you are done click the next button.

7. On the option features page leave the default options selected and click next.

optional features

On the ready to configure screen click configure.

ready to configure page

What happens to accounts in Azure if they are already synced?

If accounts have been synced to Azure and you then exclude them they will be deleted from Azure. In this guide, I initially synced my entire domain (over 8,000 accounts) to Azure. I then excluded several OUs that had around 5,000 accounts. When I exclude these OUs and user accounts they will be deleted from Azure. By default, there is a threshold of 500 accidental deletes. See the steps below for more details.

After I excluded over 5,000 users from Azure AD Connect, I got the following email alert.

accidental delete threshold azure ad connect

If you want to continue with removing the accounts follow these steps.

1. Disable the Azure AD Connect sync deletion threshold with the following command.

Disable-ADSyncExportDeletionThreshold
powershell command to disable delete threshold

2. Force start Azure AD Connect Sync

Use the following command to start the sync process.

Start-ADSyncSyncCycle -PolicyType Initial

3. Check the synchronization service status

Open the Synchronization service tool.

open azure ad connect sync service

Look for export in the profile name. Click on it and view the export statistics and status. Mine is showing in-progress with 1320 deletes.

check sync service status

The deletion process can take a while if you have a lot of accounts. You may also get an email notification that deletes threshold has been resolved.

delete threshold email notification

4. When done deleting the accounts set the threshold back to 500 objects.

Enable-ADSyncExportDeletionThreshold -DeletionThreshold 50

For more details refer to the article Azure AD Connect Sync: Prevent accidental deletes.

Troubleshooting

When it comes to syncing your on-premises users to Azure there can be all kinds of different issues. Below are some options to help you troubleshoot and get more details on issues you may have.

1. Azure Active Directory Connect Health

In Azure, you can check for sync errors using the Azure Health Connect tool.

troubleshoot azure ad connect

2. Azure AD Connect Troubleshoot

troubleshoot wizard connect tool

The troubleshooting wizard can help with the following:

  • Detect user principal name (UPN) mismatch if the object is synced to Azure AD.
  • Check whether object is filtered due to domain filtering.
  • Check whether object is filtered due to organizational unit (OU) filtering.
  • Check whether object sync is blocked due to a linked mailbox.
  • Check whether the object is in a dynamic distribution group that isn’t intended to be synced.
https://learn.microsoft.com/en-us/azure/active-directory/hybrid/connect/tshoot-connect-objectsync#troubleshooting-task

You will be prompted with what troubleshooting steps you would like to perform.

See the Microsoft article Troubleshoot object synchronization with Azure AD Connect sync for more details.

3. Azure AD Connect Connectivity issues

Many sync issues can be related to a network connection issue. The following are the two most common connection issues.

  • Connection to On-Premises Active Directory (Domain Controllers): The server running Azure AD Connect, needs full connectivity to your domain controllers. Make sure the following Active Directory Firewall ports are open between the servers.
    • 53 (TCP/UDP)
    • 88 (TCP/UDP)
    • 135 (TCP/UDP)
    • 389 (TCP)
    • 445 (TCP)
    • 49152 – 65535 TCP/UDP
  • Connection to Azure AD: The server that is running Azure AD Connect needs internet access to various Azure and Microsoft URLs. Refer to the document Office 365 URLs and IP Address ranges for a complete list.