I wanted on-prem Active Directory users to sign in to Microsoft Entra ID with the same password, without running a federation server. That’s Microsoft Entra Cloud Sync with password hash synchronization. I first installed the sync agent on the domain controller to get it working, then moved it to its own server.
Why hybrid identity, and why this way
One identity per person means one password, one place to disable an account, and cloud sign-in logs tied to the same user as on-prem logs. Password hash synchronization syncs a hash of the user’s password hash to Entra ID, so users sign in to cloud services with the password they already use on-prem [1]. Cloud sign-in keeps working even if the on-prem network is down, because nothing on-prem is in the sign-in path. It also turns on leaked credential detection for those accounts [1].
Cloud Sync uses a lightweight provisioning agent, and the configuration lives in the Entra admin center instead of on a sync server.
Scope sync to a group, and use its DN
Not everything in AD should reach the cloud. Admin accounts in particular should stay on-prem only. A Cloud Sync configuration’s scoping filter is one of three choices: all users, selected security groups, or selected organizational units [2]. My OU structure wasn’t designed around sync yet, so I scoped to a security group called <sync-group>. Only its direct members sync. Nested groups aren’t followed [2].
The scoping filter needs the group’s distinguished name, not its display name [2]. I typed the plain name first. The portal accepted it, nothing synced, and Provision on demand said there was nothing to do for the user. Getting the DN fixed it:
Get-ADGroup -Identity "<sync-group>" -Properties DistinguishedName | Select-Object DistinguishedName
Get-ADGroupMember -Identity "<sync-group>"
Provision on demand is the fastest way to test a single object instead of waiting for a sync cycle. It also asks for the DN:
Get-ADUser -Identity "<user>" -Properties DistinguishedName | Select-Object DistinguishedName
Fix the UPN before the user syncs
My first synced test user showed up in Entra ID with an onmicrosoft.com address. Its on-prem UPN still ended in the .local forest name, and Entra ID can’t use a domain it can’t verify, so it falls back to the tenant’s default domain [3]. Setting the UPN to the verified public domain and syncing again fixed it:
Set-ADUser -Identity "<user>" -UserPrincipalName "<user>@<public-domain>"
New AD users default to the forest’s suffix, so this is a step for every new account that should sync.
The test that matters: sign in to Microsoft’s cloud sign-in page as the synced user, with the on-prem password. That worked, which confirmed password hash sync end to end.
Move the agent off the domain controller
The agent runs fine on a domain controller, and Microsoft supports that [4]. I moved it anyway, to keep the domain controller doing only domain controller work.
Microsoft says the agent server should be treated as a Tier 0 server and hardened like one, with admin access limited to domain admins or other tightly controlled groups [4]. That decided where it lives. My first idea was the management VLAN, since it’s “admin infrastructure”. But Tier 0 assets shouldn’t share a network with lower-tier admin tools, so the new server went on the same server segment as the domain controller.
The server is Windows Server 2025 with a static IP on that segment, joined to the domain, with no extra roles. The migration was:
- Download the provisioning agent from Entra ID > Entra Connect > Cloud sync and install it on the new server.
- Confirm both agents show as active in the Cloud Sync agent list.
- Run Provision on demand for a test user, so the new agent is proven before anything is removed.
- Uninstall the provisioning agent from the domain controller.
- Confirm the domain controller’s agent drops out of the list, then test sync again with only the new agent.
Doing it in that order means there’s never a moment without a working agent.
Comment section
Sorry babes, you have to sign into Github to comment. Feel free to let me know what's on your mind!