A small lab that syncs on-prem Active Directory users into Entra ID (Azure AD), although I have worked with ADSync enviroements a lot - i wanted to go through setting one up as a test lab without affecting my live tenant / AD Servers This runs alongside my existing production domain controller – this lab domain controller is purely for testing. I know Azure AD is now Entra ID however it is just habit that I call it AzureAD still.
The lab is intentionally small but modelled on a real small-business setup. It sits alongside my existing production AD environment — this one is for testing only.
Creating the Windows Server VM in Proxmox
I uploaded my Windows Server ISO into Proxmox and created two VMs: SRV-LAB-DC01 and SRV-LAB-DC02.
Installing the AD DS role
I installed the AD DS role but did NOT install DNS or DHCP because those are handled by my OPNSense firewall
Promoting SRV-LAB-DC01 to a new forest: lab.local
I created a new forest lab.local, set a strong DSRM password, and accepted the defaults.
SRV-LAB-DC02 was promoted to an additional domain controller, pointing DNS to DC01.
Adding the cloud UPN suffix for Microsoft 365 login
Because .local is non-routable, I added a UPN suffix matching my Microsoft 365 domain
(e.g. mytenant.com) in
Active Directory Domains and Trusts → Properties → Alternative UPN suffixes.
Azure AD Sync Wizard
I installed Azure AD Connect on DC01 using Express setup, logged into my Microsoft 365 admin account, and provided on-prem credentials using a dedicated ADSync account.
AD Sync now showing as enabled
After running a delta sync:
Start-ADSyncSyncCycle -PolicyType Delta,
my test user appeared in Entra ID and was able to sign in using the cloud UPN suffix.
This environment was made to help me mess with things without touching my production 365 tenant and AD Server. I also wrote this guide for people out there who are interesting in doing the same for testing.