Had to build domain controllers often for production and testing. These are my handy commands which i use to add domain controllers or build fresh environments in production, and to quickly build labs for testing purposes.
Hope it will be useful for everyone. Will be covering building new domain controller and adding a domain controller.
Lets see how to build a new Domain Controller and add a additional domain controller – with Quick Powershell Commands
Step1:
Login to the first machine to build a first domain controller in the environment.
Open PowerShell – Run
Rename Computer –
Rename-Computer -NewName AD001 -Restart
Rename Domain Name as per your requirements in below commands-
Add-WindowsFeature AD-Domain-Services -IncludeManagementTools
Install-ADDSForest -DomainName "Cloudid.com" -InstallDNS
After Rebooting automatically – Primary Domain Controller is READY !!
Start – Run – dsa.msc – Just to see AD tools
====
Step2:
To Add Domain Controller
Rename-Computer -NewName AD002 -Restart
Login to the new local machine – Add the machine to the domain. (Hope you already entered Primary DNS IP in the LAN)
Add-WindowsFeature AD-Domain-Services -IncludeManagementTools
Install-ADDSDomainController -InstallDns -DomainName "Cloudid.biz"
After Reboot – Secondary Domain Controller is added.
Thanks for this wonderful examples and explanations.