This tutorial provides a step-by-step guide on setting up a basic home lab with an Active Directory (AD) using Hyper-V Manager and creating 1000 users in AD with PowerShell.
- PowerShell
- Command Prompt
- Hyper-V Manager
- Windows 11 Pro/Enterprise (22H2)
- Virtual Machines Setup
- Create 2 Virtual Switches ("NAT" and "SUBNETA")
- Create 2 Virtual Machines ("DC1" and "Client1")
- Install & Configure AD, RAS/NAT, DHCP
- Create 1000 Users in AD using PowerShell
- Join "Client1" to the Domain
- Log in to "Client1" with a Created User
Open Hyper-V Manager. Right-click on the local machine and select Virtual Switch Manager. Alternatively, select Virtual Switch Manager from the Action pane.
Next, click on New Virtual Network Switch and create two virtual switches:
- NAT (External)
- SUBNETA (Private)
- Configure the Virtual Machine settings to match the summary shown below.
- Attach Windows Server 2016 ISO to the DC1 virtual machine.
- Right-click on DC1, select Settings.
- Add a second network adapter:
- NAT for external access
- SUBNETA for internal network
- Start DC1 and install Windows Server 2016.
- Open System Properties in DC1.
- Click Change next to the computer name.
- Rename the computer to DC1.
- Restart the machine to apply the changes.
- Open Network Settings in DC1.
- Rename NAT and SUBNETA for easy identification.
- Open Network Settings on DC1.
- Locate the SUBNETA (Private Network) adapter, right-click on it, and select Properties.
- In the list of items, select Internet Protocol Version 4 (TCP/IPv4), then click Properties.
- Select Use the following IP address and enter the following values:
- IP address:
172.16.0.1 - Subnet mask:
255.255.255.0 - Preferred DNS server:
127.0.0.1
- IP address:
- Click OK to save the settings and close the dialog.
- Repeat the steps to create a new Virtual Machine named Client1.
- Connect Client1 to SUBNETA.
- Attach Windows 10 ISO and install Windows 10 Pro.
- Complete the Windows 10 installation on Client1.
- Open System Properties in Client1.
- Click Change next to the computer name.
- Rename the computer to Client1.
- Restart the machine to apply the changes.
- Open Server Manager on DC1.
- Click Add roles and features.
- Select Role-based or feature-based installation and click Next.
- Select DC1 and click Next.
- Select Active Directory Domain Services and click Add Features when prompted.
- Click Next through the wizard, then click Install.
- After installation, click Promote this server to a domain controller in the notification area.
- In the Deployment Configuration window, select Add a new forest.
- Enter a Root domain name (e.g.,
homelab.local), and click Next. - Set the Forest functional level and Domain functional level to Windows Server 2016.
- Enter and confirm a Directory Services Restore Mode (DSRM) password.
- Click Next through the rest of the wizard and click Install.
- The server will restart automatically after promotion.
- Open Server Manager.
- Click Add roles and features.
- Select Remote Access and click Next.
- Under Role Services, select Routing and click Add Features when prompted.
- Complete the installation and open Routing and Remote Access from Tools in Server Manager.
- Right-click on DC1 (in the Routing and Remote Access console) and select Configure and Enable Routing and Remote Access.
- Select Custom configuration, check NAT, and click Next.
- Click Finish, then Start service.
- Expand IPv4, right-click NAT, and select New Interface.
- Select NAT (External Network) and click OK.
- Select Public interface connected to the Internet and check Enable NAT on this interface.
- Click OK.
- Repeat New Interface for SUBNETA (Private Network), select Private interface connected to the private network, and click OK.
- Open Server Manager.
- Click Add roles and features.
- Select DHCP Server and click Next through the wizard. Click Install.
- After installation, open DHCP from Tools in Server Manager.
- Expand DC1, right-click IPv4, and select New Scope.
- Click Next and enter a Scope Name (e.g.,
SUBNETA), then click Next. - Enter the IP address range (e.g., 172.16.0.100 to 172.16.0.200) and Subnet mask (255.255.255.0), then click Next.
- Add any Exclusions if necessary or click Next.
- Set the Lease Duration as desired, and click Next.
- Select **Yes, I want to configure these
- Step 3 – Create 1000 Users in AD with PowerShell
- Step 4 – Join Client1 to the Domain
- Step 5 – Login to Client1 as a Created User





