Windows Server and Active Directory on AWS
This activity puts into practice the concepts from the Windows Server Administration lecture. You will deploy two Windows Server instances on AWS, promote one to a domain controller, join the other as a client, create users and organizational units, and apply a Group Policy Object. By the end, you will have built a working Active Directory domain from scratch.
What You Will Need
Section titled “What You Will Need”- Your AWS Academy Learner Lab session started
- A laptop with a Remote Desktop client installed:
- Windows: Remote Desktop Connection (built-in, search “Remote Desktop” in the Start menu)
- macOS: Windows App from the App Store
- Linux: Remmina or another RDP client
Set Up the Network (VPC)
Section titled “Set Up the Network (VPC)”Before deploying any servers, you need a Virtual Private Cloud (VPC) with subnets in two Availability Zones. This mirrors a real deployment where domain controllers and clients may sit in different data center zones for resilience.
-
In the AWS Console, navigate to VPC dashboard.
-
Click Create VPC and select VPC and more to create the VPC along with its subnets and routing in one step.
-
Configure:
- Name tag:
cs312-ad - IPv4 CIDR block:
10.3.12.0/22 - IPv6: None
- Tenancy: Default
- Availability Zones: 2
- Public subnets: 2
- Private subnets: 0
- NAT gateways: None
- VPC endpoints: None
- Name tag:
-
Click Create VPC and wait for it to finish. Note the VPC ID.
-
Navigate to Security Groups (under the Security section in the VPC sidebar). Find the default security group associated with your new VPC (match the VPC ID).
-
Edit the Inbound Rules of that security group. Keep the existing rule (which allows traffic within the security group) and add a new rule:
- Type: RDP
- Source: Your current IP address (use “My IP” in the dropdown, or enter the campus/home CIDR, or just 0.0.0.0/0)
This allows you to connect via Remote Desktop from your machine.
Deploy the Domain Controller
Section titled “Deploy the Domain Controller”-
Navigate to the EC2 Dashboard. Click Launch Instance.
-
Configure the instance:
- Name:
DomainController - AMI: Microsoft Windows Server 2025 Base
- Instance type:
t3.small - Key pair: Use your existing key pair or create a new one (you will need this to retrieve the Administrator password and connect via RDP)
- Name:
-
Under Network settings, click Edit:
- VPC: Select
cs312-ad-vpc - Subnet: Select the one ending in
a - Auto-assign public IP: Enable
- Firewall: Select existing security group, choose the
defaultgroup for your VPC
- VPC: Select
-
Launch the instance.
-
Retrieve the Administrator password. It takes a few minutes after launch before the password is available. Select the instance, click Connect, choose the RDP client tab, and click Get password. Upload your
.pemkey file and decrypt. -
Connect via RDP. Open your Remote Desktop client, enter the instance’s Public IPv4 address, and log in as
Administratorwith the decrypted password.
Install Active Directory Domain Services
Section titled “Install Active Directory Domain Services”Once connected to the DomainController via RDP:
-
Open Server Manager (it should launch automatically; if not, find it in the Start menu).
-
Click Add roles and features (option 2 on the dashboard).
-
Walk through the wizard:
- Installation type: Role-based or feature-based installation
- Server selection: Select the current server
- Server Roles: Check Active Directory Domain Services. Accept the prompt to add required features.
- Click through the remaining pages and click Install. Wait for installation to complete.
-
After installation, a warning flag appears in Server Manager’s top menu. Click it and select Promote this server to a domain controller.
-
In the promotion wizard:
- Select Add a new forest
- Root domain name:
cs312lab.local
-
Set a Directory Services Restore Mode (DSRM) password on the next page. This password is used for offline recovery of the AD database; in production, you would store it securely.
-
Ignore the DNS delegation warning and click Next.
-
Leave the NetBIOS name as the default:
CS312LAB. -
Accept the default directories for the database, log files, and SYSVOL. Continue through the wizard and click Install.
-
The server will reboot automatically. Wait a minute, then reconnect via RDP. The login will now show the domain: log in as
CS312LAB\Administrator.
Deploy a Client Machine
Section titled “Deploy a Client Machine”-
Return to the EC2 Dashboard and launch a second instance:
- Name:
WindowsClient - AMI: Microsoft Windows Server 2025 Base
- Instance type:
t3.small - Key pair: Use the same key pair you created earlier
- Name:
-
Network settings:
- VPC:
cs312-ad-vpc - Subnet: Select the one ending in
b(a different AZ from the DC) - Auto-assign public IP: Enable
- Security group: Select the same
defaultgroup
- VPC:
-
Launch the instance and retrieve the Administrator password using the same key pair.
-
Connect via RDP.
Point the Client’s DNS to the Domain Controller
Section titled “Point the Client’s DNS to the Domain Controller”On the WindowsClient machine:
-
Open Advanced network settings (search “network” in the Start menu).
-
Click Edit under “More adapter options” under the Ethernet adapter.
-
Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
-
Change to Use the following DNS server addresses:
- Preferred DNS server: Enter the private IP of your DomainController (find it in the EC2 console; it will be something like
10.3.12.x) - Leave the alternate DNS server blank
- Preferred DNS server: Enter the private IP of your DomainController (find it in the EC2 console; it will be something like
-
Click OK to save.
-
Verify DNS resolution by opening a Command Prompt and running:
Ping Domain Name ping cs312lab.localYou should see replies from your domain controller’s private IP.
Join the Client to the Domain
Section titled “Join the Client to the Domain”-
On the WindowsClient, search for “workgroup” in the Start menu and select Change workgroup name.
-
In the System Properties dialog, click Change.
-
Under “Member of”, select Domain and enter
cs312lab.local. Click OK. -
When prompted for credentials, enter the DomainController’s administrator credentials:
- Username:
Administrator - Password: the DC’s Administrator password
- Username:
-
You should see a “Welcome to the cs312lab.local domain” message. Click OK, close the dialogs, and restart the client.
Create an Organizational Unit, User, and Group
Section titled “Create an Organizational Unit, User, and Group”On the DomainController:
-
In Server Manager, click Tools > Group Policy Management.
-
In the left sidebar, expand Forest: cs312lab.local > Domains > cs312lab.local.
-
Right-click
cs312lab.localand select New Organizational Unit. Name itLab Computers. Click OK. -
Right-click
cs312lab.localagain and select Active Directory Users and Computers. -
In the AD Users and Computers window, find the Computers container in the left sidebar. You should see your WindowsClient machine (with an auto-generated name like
EC2AMAZ-...). Drag it into the Lab Computers OU.AD will warn you about moving objects. Click OK. The computer is now in the OU where your GPO will apply.
-
In the left sidebar, right-click the Users container. Select New > User.
- Set a first and last name of your choice
- User logon name:
student - Click Next, set a password, and uncheck “User must change password at next logon”
- Finish the wizard
-
Right-click the new
studentuser and select Add to a group. TypeDomain Adminsand click OK.
Create and Apply a Group Policy Object
Section titled “Create and Apply a Group Policy Object”-
Back in Group Policy Management, right-click the Lab Computers OU and select Create a GPO in this domain, and Link it here. Name it
Lab Policy. -
Right-click
Lab Policyunder the Lab Computers OU and select Edit. This opens the Group Policy Management Editor. -
Disable local GPO overrides. Navigate to:
Computer Configuration>Policies>Administrative Templates>System>Group PolicyFind Turn off Local Group Policy Objects processing. Double-click it, set to Enabled, and click OK.
-
Enable loopback processing. In the same folder, find Configure user Group Policy loopback processing mode. Set to Enabled with Mode set to Replace. Click OK.
This ensures that user settings applied to this OU’s computers override user-specific settings from other OUs, which is important for shared or lab machines.
-
Add a system PATH entry. Navigate to:
Computer Configuration>Preferences>Windows Settings>EnvironmentRight-click Environment and select New > Environment Variable. Configure:
- Action: Create
- Check System Variable
- Check the PATH checkbox (this sets the Name to PATH)
- Check Partial (append rather than replace)
- Value:
C:\Users\Public\cs312
Click OK. This adds a directory to the system PATH on every computer in the OU, demonstrating how GPOs can push configuration changes across an entire fleet.
-
Close the editor windows.
Test the Domain Configuration
Section titled “Test the Domain Configuration”-
Connect to the WindowsClient via RDP. This time, log in with the domain account:
- Username:
CS312LAB\student - Password: the one you set when creating the user
- Username:
-
The first login for a new domain user takes extra time as Windows creates the user profile. Be patient.
-
Open a Command Prompt and verify your identity:
Check Domain Login Identity whoamiThis should return
cs312lab\student. -
Force Group Policy to apply immediately (rather than waiting up to 90 minutes for the automatic refresh):
Force Group Policy Update gpupdate /force -
Verify the GPO took effect by checking the PATH:
Check Updated PATH echo %PATH%You should see
C:\Users\Public\cs312in the output. Restart the command prompt for the change to take effect if you don’t see it immediately. -
For a detailed report of which computer-side GPOs are applied to this machine, open Command Prompt as administrator and run:
Generate Group Policy Report gpresult /scope computer /rLook for
Lab Policyunder “Applied Group Policy Objects.”
Cleanup
Section titled “Cleanup”-
In the EC2 Dashboard, select both instances (DomainController and WindowsClient). Click Instance state > Terminate instance.
-
In the VPC Dashboard, delete the
cs312-ad-vpcVPC (this also removes its subnets, route tables, and internet gateway). -
Delete the key pair if you no longer need it.