26 C
Dubai
Friday, November 22, 2024

Active Directory Quick Deployment scripts in Windows 2012 R2 – New/Add

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

image

====

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.

AD

 

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?