Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Microsoft Active Directory Logo

On-premises Active Directory Deployed in the Cloud (Azure)

This guide walks you through deploying an on‑premises‑style Active Directory environment using Azure Virtual Machines.

Environments and Technologies Used

  • Microsoft Azure (Virtual Machines/Compute)
  • Remote Desktop
  • Active Directory Domain Services
  • PowerShell

Operating Systems Used

  • Windows Server 2022
  • Windows 10 (21H2)

High-Level Deployment and Configuration Steps

  • Provision DC‑1 (Windows Server) and Client‑1 (Windows 10) in Azure.
  • Configure static addressing on DC-1 (NIC)
  • Ensure network connectivity between Client‑1 and DC‑1.
  • Install Active Directory Domain Services and promote DC‑1 to a new forest.
  • Create OUs and user accounts (admin + standard).
  • Point Client‑1 DNS to DC‑1, join domain (e.g., mydomain.com).
  • Enable Remote Desktop for non‑administrator domain users on Client‑1.
  • (Optional) Bulk‑create test users and sign in with one of them.

Deployment and Configuration Steps

Step 1: Deploy Azure Resources

Create two VMs in the same Resource Group and Virtual Network.

  1. Create DC‑1 (Windows Server 2022)
  2. Create Client‑1 (Windows 10)
  3. Ensure both VMs are in the same VNet/subnet
vms

Notes & Tips:

  • Choose the region closest to you.
  • On Azure Free subscription, VM sizes vary by region/zone—pick supported sizes and place both VMs in the same availability zone.
  • DC‑1 should be Windows Server; Client‑1 is Windows 10.
  • A size like 2 vCPU / 16 GiB is sufficient for this lab.
  • Record the admin username/password you set during VM creation.
  • If the VNet created with DC‑1 doesn’t appear when creating Client‑1, wait a minute and retry; it should show under Virtual network.

Step 2: Set DC‑1 NIC to Static IP

Give DC‑1 a static private IP so DNS and domain services remain stable.

  1. Open DC‑1 → Networking → Network settings → IP configurations.
  2. Select ipconfig1 and change Allocation to Static.
  3. Save the change.

Step 3: Verify Client ↔ DC Connectivity

Confirm Client‑1 can reach DC‑1.

428757709-0d87934c-ecbf-4062-8e22-dd29b5c00add
  1. Remote Desktop Protocol (RDP) into Client‑1 with the credentials created at deployment.
  2. From the Azure portal, copy DC‑1’s private IP (Networking tab).
Priv IP
  1. On Client‑1, open Command Prompt and start a continuous ping:

    ping -t <DC1_PRIVATE_IP>

    It may time out initially due to DC‑1 firewall.

  2. RDP into DC‑1 and open Windows Defender Firewall with Advanced SecurityInbound Rules.

  3. Sort by Protocol, find ICMPv4 rules, and Enable the echo request rules.

428757709-0d87934c-ecbf-4062-8e22-dd29b5c00add
  1. Return to Client‑1 and verify Replies are now received.
428757709-0d87934c-ecbf-4062-8e22-dd29b5c00add

Step 4: Install AD DS & Promote DC‑1

Install Active Directory Domain Services and create a new forest/domain.

  1. On DC‑1, open Server ManagerAdd Roles and Features.
  2. In Server Roles, select Active Directory Domain Services; proceed to Install.
333888925-e1bbdf7a-e940-424a-8b01-9bdd07d10175
  1. After installation, click the yellow flag in Server Manager → Promote this server to a domain controller.
68747470733a2f2f692e696d6775722e636f6d2f59343558427a4c2e706e67
  1. Choose Add a new forest and specify a domain name (e.g., mydomain.com).
  2. Set a DSRM password (note it down for lab purposes).
  3. Complete the Prerequisites Check and Install.
333889334-84311ab0-bc5c-4f03-97b9-6d8b84cc2594
  1. Reboot if not automatically restarted.
  2. Reconnect to DC‑1 (your sign‑in name may change to the domain format).

Step 5: Create Organizational Units (OUs) and Admin/Standard Users

Organize your directory and create administrative and standard accounts.

  1. On DC‑1, open Tools → Active Directory Users and Computers (ADUC).
  2. Create some Organizational Units (OUs), e.g., _EMPLOYEES and _ADMINS (use a prefix like _ to make lab OUs easy to find).
333889334-84311ab0-bc5c-4f03-97b9-6d8b84cc2594
  1. Create your admin account in the _ADMINS OU. Consider:
    • Unchecking User must change password at next logon (for lab simplicity).
    • Checking Password never expires (lab only).
  2. Make the new admin a member of Domain Admins (ADUC → user PropertiesMember OfAdd → type Domain Admins).
  3. Sign out and sign in as MYDOMAIN\your_admin (or your_admin@mydomain.com).

Step 6: Join Client‑1 to the Domain

Configure DNS and join Client‑1 to the MYDOMAIN domain.

Pre‑Req: Point Client‑1 DNS to DC‑1’s private IP.

  1. In the Azure portal, note DC‑1’s private IP (Networking → private IP).
  2. On Client‑1 → Networking → DNS servers, switch to Custom and enter DC‑1’s private IP.
333889334-84311ab0-bc5c-4f03-97b9-6d8b84cc2594
  1. Save, wait for update, then Restart Client‑1 from the portal to flush DNS.
  2. After reboot, RDP into Client‑1.
  3. Right‑click Start → System → Rename this PC (advanced)Change.
  4. Select Domain, enter mydomain.com (or your chosen domain), and OK.
333894143-9bc26a02-a162-4580-89fd-e8a1251dc9a7
  1. When prompted, use domain credentials (your domain admin from step 5).
  2. Reboot when prompted; then sign in using domain credentials.

Step 7: Enable RDP for Non‑Admins on Client‑1

Allow all Domain Users to log in via Remote Desktop.

333894143-9bc26a02-a162-4580-89fd-e8a1251dc9a7
  1. On Client‑1: System → Remote Desktop → Select users… → Add…
  2. Type Domain Users, click Check Names, then OK.
68747470733a2f2f692e696d6775722e636f6d2f613875594738582e706e67
  1. All members of Domain Users can now RDP to Client‑1.
  2. On DC‑1, open ADUC → Users → Domain Users → Members to see group membership.

Step 8: Optional: Bulk‑Create Users via PowerShell

Populate _EMPLOYEES OU with many test users, then sign in as one from Client‑1.

  1. On DC‑1, open PowerShell ISE as Administrator.
  2. Use the community script (credit below) to generate users:

https://github.com/joshmadakor1/AD_PS/blob/master/Generate-Names-Create-Users.ps1

  1. Copy the raw code and paste into a new ISE script file.
  2. (Recommended) Reduce the number of accounts (e.g., from 10k to 1k) for a faster lab run.
  3. Run the script (F5) and watch accounts being created in _EMPLOYEES.
333894143-9bc26a02-a162-4580-89fd-e8a1251dc9a7
  1. In ADUC, pick a random user → Properties → Account to view the logon name.
  2. Sign out of Client‑1 and RDP back in using the chosen user and the script’s default password (usually Password1).
  3. If an account becomes locked, on DC‑1 you can Unlock, Reset password, or Disable via ADUC.
xul xul start

Credit: Script by Josh Madakor.


Congratulations! Hopefully, the installation has been completed without any errors.


Troubleshooting

  • Ping fails from Client‑1: Ensure ICMPv4 inbound rules enabled on DC‑1; confirm both VMs share the same VNet.
  • Domain join fails: Verify Client‑1 DNS points to DC‑1’s private IP. Reboot Client‑1 after DNS change.
  • Slow logons or name resolution issues: Check DNS and time sync; ensure DC‑1 has a static IP.
  • Cannot RDP as standard user: Confirm Domain Users is added to Remote Desktop Users on Client‑1.

Cleanup

  • Delete the Resource Group(s) and VM(s) in Azure once done to avoid charges.

Closing Thoughts

Building an on-premises Active Directory lab in Azure is a practical peek into real IT operations. I covered identity, networking, security, and automation in a hands-on exercise that maps directly to day-to-day responsibilities across IT roles.


About

Deployment of Active Directory on Azure Virtual Machines

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors