A few weeks ago I’ve posted an article about how to remotely Install a domain controller within Windows 2012 Server using the Server Manager.
How to: Windows 2012 Server Deploy remote domain controllers using Server Manager – Part I of II
Since Windows 2012 Server, creating a new domain controller is much eassier then ever before. There is another option to create a new domain controller….Yes, using Windows PowerShell!!
As you can see in part I of the post, there are two domain controllers. I have installed a clean Windows 2012 Server within my labenvironment, called Server2.
1.) Logon to Server1 with the Administrator account
2.) Open Windows PowerShell
3.) Type the following command:
Install-WindowsFeature -Name AD-Domain-Services -ComputerName Server2
4.) After the Windows feature is installed succesfully, type the following command:
Invoke-Command –ComputerName Server2 –ScriptBlock {Import-Module ADDSDeployment;Install-ADDSDomainController –NoGlobalCatalog:$False –CreateDNSDelegation:$False –Credential (Get-Credential) –CriticalReplicationOnly:$False –DatabasePath “C:\Windows\NTDS” –DomainName “Contoso.com” –InstallDNS:$True –LogPath “C:\Windows\NTDS” –NoRebootOnCompletion:$False –SiteName “Default-First-Site-Name” –SysVolPath “C:\Windows\SysVol” }
When prompted for credentials, enter the username and password of your domain administrator account!
In my labenvironment, I have used the following parameters:
-ComputerName, this is the name of the new domain controller
-NoGlobalCatalog:$False, the new domain controller becomes also an Global Catalog Server
-CreateNDSDelegation:$False, there are no ohter DNS servers available for DNS delegation
-Creadential(Get-Credential), before executing the command, there will be an popup asking your admin crerdentials
-CriticalReplicationOnly:$False, this entry specifies whether the installation operation performs only important replication before a restart and then skips the noncritical and potentially lengthy part of replication. The noncritical replication occurs after the role installation is complete, and the computer restarts
-Databasepath, the location of the ADDS database (NTDS.DIT)
-DomainName, specifies the fully qualified domain name of your domain
-InstallDNS:$True, the new domain controllers becomes also an DNS server
-LogPath, this is the path of the fully qualified, non-UNC directory on a hard disk on the local computer that will host the AD DS log files.
-NoRebootOnCompletion:$False, there will be no reboot at the end of the installation
-SiteName, this is the name of your Active Directory site where the new domain controller becomes a member of
-SysVolPath, this folder contains all content replicated to the other domain controller (NETLOGON and SYSVOL directories)
5.) After executing the commands above, and the installation has finished, the new domain controller becomes vissible in your Active Directory environment
6.) All you have to do now is waiting for the next Active Directory replication, so all your domain controllers are synchronized