Set up Entra Cloud Sync for an AD DS domain

Azure Portal, Hands On30 minutes in a test labFreeSteps checked 13 November 2026By Cloud Hands On

In this task you'll set up Entra Cloud Sync.

Entra Cloud Sync copies users and groups from an AD DS domain into Entra ID. You install a small provisioning agent on a Windows server in the domain, then create the sync settings in the portal.

This task needs a test AD DS domain. If you don't have one, read it through and open the portal pages without saving anything. A small Windows Server VM in Azure promoted to a domain controller costs about £0.15 an hour; our own test took about three hours.

Sign in to the agent with a work account that belongs to the tenant (a cloud-only account such as name@yourtenant.onmicrosoft.com with the Hybrid Identity Administrator role). A personal Microsoft account added to the tenant as a guest can't be used. With security defaults on, it will ask the account to set up the Authenticator app the first time.

Example. SS Kaiser installs the agent on two servers in its office, syncs only the Staff organisational unit, and turns on password hash sync, so store staff use their office password for cloud apps.

Before you start

You need: A work account in the tenant with Hybrid Identity Administrator, and a domain admin account in AD DS. Time: 30 minutes in a test lab.

Where to look

  1. Home
  2. Microsoft Entra ID
  3. Microsoft Entra Connect
  4. Cloud Sync

Steps

  1. Sign in to the server that will run the agent, open a browser there and go to the Entra admin center. In Microsoft Entra Connect, Get started, open the Manage tab and select Download Provisioning agent (or Cloud Sync, Monitor, Agents, Download on-premises agent).Download it on the server itself, not on your own PC. A domain-joined member server is best; a domain controller works for a test.
  2. Run AADConnectProvisioningAgentSetup.exe, tick the licence terms and select Install. The configuration wizard opens when it finishes.
  3. In the wizard: Connect Microsoft Entra ID (select Authenticate and sign in with the Hybrid Identity Administrator work account), Configure Service Account (keep Create gMSA and give a domain admin such as DOMAIN\admin), Connect Active Directory (your domain should be listed), then Confirm and Exit.The wizard creates a group managed service account called provAgentgMSA in AD DS, so there's no service password to look after.
  4. Back in the portal, open Cloud Sync, Monitor, Agents. The server appears under All agents registered to this tenant with status active. Select Refresh if it's not there yet.Install a second agent on another server for resilience.
  5. Select Configurations, then New configuration, AD to Microsoft Entra ID sync. Pick your domain, leave Enable password hash sync ticked, and select Create. It takes about a minute and opens the configuration's Overview.Microsoft Entra ID to AD sync stays greyed out without Entra ID P1 or P2.
  6. In the configuration's menu, open Manage, Scoping filters. Choose Sync selected organizational units, type the OU's distinguished name (such as OU=Staff,DC=larkfield,DC=local), select Add, then Save.Start small. Syncing the whole domain at once makes mistakes hard to undo.
  7. Open Provision on demand, type one test user's distinguished name (such as CN=Amira Khan,OU=Staff,DC=larkfield,DC=local) and select Provision. Four steps appear: import, scope, match, then the action, such as Successfully created object in Microsoft Entra ID. View details on each step explains it.A user outside the selected OUs comes back as Object was skipped, with SkipReason JoinNotFound.
  8. When the test user looks right, open Overview and select Review and enable. Check the summary (password hash sync Enabled, Prevent accidental deletion Enabled with a threshold of 500, your scoping filter) and select Enable configuration.The first cycle runs within a couple of minutes. Synced users with a name ending in a non-routable domain such as .local appear in Entra ID as name@yourtenant.onmicrosoft.com.

Commands

# Setting up Cloud Sync happens on the server and in the portal, not in the CLI.
# Afterwards, list the users that came from AD DS (through Microsoft Graph):
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/users?\$filter=onPremisesSyncEnabled eq true&\$count=true&\$select=displayName,userPrincipalName" \
  --headers ConsistencyLevel=eventual

Watch out for

Cost
Cloud Sync is free with Entra ID. The only cost is the server the agent runs on.
Security
The agent's server can change identities in your tenant, so keep it patched and limit who can sign in to it. Use a dedicated admin account for the set-up.
Common mistakes
Syncing the whole domain first time. Having two users with the same UPN or email address, which causes sync errors. Editing synced users in the portal instead of in AD DS.

Clean up

  1. Cloud sync
  2. your configuration
  3. Delete

In a test lab, delete the synced test users in AD DS first and wait for the next sync, which removes them from Entra ID (it took about 7 minutes in our test); then purge them from Deleted users. Synced users can't be deleted in the portal while sync is on. Then delete the configuration and uninstall the agent, or delete the test server. The tenant's directory sync setting stays on until you turn it off with Microsoft Graph PowerShell.

Words to know

Provisioning agent
A small program on a server in your domain that talks to Entra ID and carries out the sync.
Organisational unit (OU)
A folder inside AD DS. You can choose to sync only some OUs.
Provision on demand
A button that syncs one chosen user straight away, to test your settings.

Tick off each step and track your progress in the guide.

Open this task in Azure Portal, Hands On

Keep going