This is a guide intended to show the steps to set up AD for a lab and not meant for large-scale deployment as you would deploy these services on different servers.
AD GUI
This section will guide you through setting up the first Domain Controller (DC) in a forest.
1.) In server manager click the add roles and features:
2.) click next till you get to server roles (if using RSAT on another system make sure to select the correct server in server selection). Check the ADDS role.
3.) After checking the ADDS box, you will be presented to add the required features for ADDS management. Click the “Add Features” to continue.
4.) Click next till you get to the confirmation page and check the “restart the destination server automatically if required” and click “yes”.
5.) Now click the “install” button and either wait for it to complete or close the window and wait for the notification in server manager from the next step.
6.) Now we will promote the server to the first DC in a Forest. In server manager, you will see a notification, click on the “Promote this server to a domain controller”
7.) in the ADDS configuration wizard select “Add a new forest”. In the Root domain name enter your domain name, some people use the domain.local but this is a dated method and can cause issues with browsing within the domain.
8.) Set the DSRM password and click next.
9.) If using root level or .local you can create the DNS delegation and click next.
10.) Pick a netbios domain name, this is for domain\user usage and click next.
11.) The paths are ok for lab purposes so next to the prerequisites check and make sure all pass then click install. This will require a reboot and then you will login to the domain admin upon restart.
AD PowerShell
This section will guide you through setting up the first Domain Controller (DC) in a forest.
The install windows feature adds ADDS and the tools needed to manage it. This is steps 1-5 in the GUI.
Install-WindowsFeature -name AD-Domain-Services -IncludeMnagementTools
The install-ADDSForst command will setup the server as a DC and create the domain. This is steps 6-11 in the GUI.
Install-ADDSForest -DomainName "ad.domain.com" -DomainNetBiosName "domain" -InstallDns:$true -NoRebootCompletion:$true
Restart-Computer