Skip to content

2. First Domain Controller (In Hyper V)

Richard "Dick" Tracy edited this page Dec 16, 2022 · 3 revisions

Overview

The first domain controller will be create in Hyper-V. Ensure the network is setup and working properly; follow [these](HyperV Networking) instructions

Prep software

  • Download a Windows Server 2019 from my visual studio
  • Copy Windows Server 2019 Datacenter, and versions 1903, 1909, 2004, and 20H2 - Retail Key to test file

Prep Hyper-V network

  1. Open Hyper-V Manager
  2. In right pane, click Virtual Switch Manager...
  3. In Virtual Switch Manager window:
    1. Select New virtual network switch
    2. Select External, the click create Virtual switch
    3. Give the virtual switch a name....such as external network
    4. select the wireless external network
    5. Click Apply. (this may interrupt internet connectivity for a short bit)

Create Hyper-V Virtual Machine using these settings.

  1. Expand Hyper-V Manager
  2. Right click computer name --> New \ Virtual Machine
    1. Give it a name that reflectsyour lab name (eg. LAB-DC1)
    2. Generation: 2
    3. Assign Memory: 4096mb with Dynamic Memory off
    4. Network: Connect to External network. (the one you created earlier)
    5. Virtual Hard Disk: 120 GB
    6. Installation an Operating system from bootable CD/ROM
    7. Select Image. Browse to the Server 2019 ISO downloaded earlier
  3. Right click new machine and click Settings
    1. Navigate to Processor
    2. Change to 2 processors
    3. Navigate to Checkpoints
    4. Uncheck Enable Checkpoints
  4. Click OK
  5. Right click new machine and click Connect
  6. When window opens click the power button or Start
  7. If prompted to boot from CD click any key. This can be difficult to catch. try pressing Action-->Reset. Then once prompted click Reset, then immediately click within the black window with mouse and then hit any key to start booting from ISO
  8. When boot to install screen
    1. Click Next
    2. Click Install Now
    3. Type in Serial Key
    4. Select Windows Server 2019 Datacenter (Desktop Experience)
    5. Accept EULA
    6. Click Custom: Install Windows Only
    7. Highlight the Unallocated space, click next
    8. The installation can take some time.
    9. When complete it will ask for local admin password; type in a password
  9. Done

Installing Domain controller Role

  1. Log into new server
  2. Server manager will launch
  3. Click Local server on Left
    1. Click on Computer Name
    2. On popup click Change.
    3. Set the name to same as Virtual Machine Name (eg. LAB-DC1)
    4. Click ok then Reboot Now
  4. Log back into server
  5. When server manager launches, Click Manage-->Add Roles and Features
    1. Under server Roles, check Active Directory Domain Services
    2. Click Add Features on popup
  6. Click Next through each window
  7. Click Install. 
  8. Click Close when complete
  9. Open Command prompt
    1. Run command: ipconfig
    2. Keep command window open
    3. Run command: ncpa.cpl
  10. Right click the Network Interface-->properties
    1. Highlight Internet protocol Version 4 (TCP/IPv4)
    2. Click Properties
    3. Select Use the following IP addresses
    4. Set each entry to what is displayed in command window
    5. Set Preferred DNS server to Server's IPv4

Setting up First Domain Controller

  1. In Server Manager, you will see a Flag with a Warning symbol next to it. Click it and select Promote this server to a domain controller
  2. At the Promote DC screen, Select add a new forest
  3. Provide a root domain name (Eg. mylab.com)

Must be as full qualified domain (eg. <second level domain>.<top level domain>)

  1. Make all functional levels are at Windows Server 2016
  2. Check Domain Name System (DNS) Server
  3. Check Global Catalog (GC)
  4. Provide recovery password
  5. Click all the way through.

During Prerequisites check, there may be warnings. make sure there are not errors though!

Network Checklist

This checklist is to be used during the networking configuration. Values that are prefilled in can be used, but they can be changed if needed; make sure you read the comments.

Name Values Comment
Lab Name Lab
Domain Name It is best to create a unique domain
Azure Hub Name Lab-Hub-Subnet1
Azure Hub CIDR 10.10.0.0/16
Azure Hub Subnet 1 10.10.0.0/24 Specify a space within Hub's CIDR
Azure Hub Gateway 10.10.200.0/26 Specify a space within Hub's CIDR Subnet but does not conflict with subnet 1
Azure Spoke Name Lab-Spoke-Subnet1
Azure Spoke CIDR 10.20.0.0/16
Azure Spoke Subnet 1 10.20.0.0/24 Specify space within Spoke's
Azure Spoke Subnet 2 10.20.1.0/27 Bastion Subnet
Azure VPN ASN Port 65010
IPSec Shared Key This will be generated when setting up VYOS router.
Azure Gateway Public IP This can be retrieved once a gateway has been created in Azure.
Home Public IP The home network where the device connected to will be hosting Hyper-V guests, go to: https://ipinfo.io/json .
Hyper-V Subnet 1 10.100.1.0/24 Cannot conflict with Azure subnets
Hyper-V Subnet 2 10.100.2.0/24 Cannot conflict with Azure subnet
Azure VM: Domain 10.20.0.1 Use this to configure Azure
Controller IP subnets internal DNS. If multiple DC's are created, each IP will need to be added.
Clone this wiki locally