Introduction
In this tutorial, we will see how to add an Active Directory domain controller to an existing domain using PowerShell.
To do this through the GUI, I invite you to read this article: Add an AD DS Domain Controller to an Existing Domain. (fr)
Adding a domain controller to PowerShell is done in two command lines, which saves time….
Prerequisites
On the server that is going to be promoted domain controller, it is necessary:
- A fixed IP address.
- Configure an existing domain controller as a DNS server on the network adapter.
- Make sure the ping of the domain name answers.
Dans le cas d’ajout où vous ajoutez un contrôleur de domaine sur une autre plage IP et que vous en novice, je vous conseille avant la lecture du l’article pour le faire en mode graphique et l’article suivant : Active Directory : configuration multi sites, sous réseau et réplication.
Installing the ADDS role in PowerShell
From a Powershell command prompt launched as administrator enter:
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
Wait during the installation ….
The AD DS role is installed:
Domain Controller Promotion in PowerShell
Always from a Powershell command prompt enter:
Install-ADDSDomainController -DomainName "domain.tld" -InstallDns:$true -Credential (Get-Credential "DOMAIN\administratreur")
Enter the password of the account passed as a parameter in the login window, then in the Powershell console enter the password of the directory recovery mode and confirm the promotion as a domain controller.
Wait during the promotion operation ….
After the operation completes, the following message appears and the server restarts.
At reboot the server is domain control.
Complements
There are 3 different Powershell commands that allow promotion as a domain control. Each of the commands is to be used in a particular case:
- Install-ADDSForest : which is used for creating a new Active Directory forest.
- Install-ADDSDomain : which is used to create a domain in an Active Directory forest (adding a child domain).
- Install-ADDSDomainController : which is used to add an Active Directory domain controller to an existing domain.