After showing you How To Deploy Active Directory Domain Controller Using PowerShell Script Yesterday, Today I’ll show you how to deploy an Active Directory Sub Domain In unattended mode using a PowerShell script.
Before you start, First join the server to the domain and Install the AD DS module.
The script below, will create a new sub domain called DEV In a forest called Test.local, Install DNS, Set domain mode, and set the Sub domain administrator password.
Install-ADDSDomain -Confirm:$false -NewDomainName dev -ParentDomainName test.local -InstallDNS -CreateDNSDelegation -DomainMode Win2012R2 -SafeModeAdministratorPassword (ConvertTo-SecureString -AsPlainText "[email protected]" -Force)
Login with the password you set In the script