# Active Directory: Add a Domain Controller to PowerShell

[https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#:~:text=Domain%20Controller%20Promotion%20in%20PowerShell,-Always%20from%20a&amp;text=Enter%20the%20password%20of%20the,Wait%20during%20the%20promotion%20operation%20%E2%80%A6](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#:~:text=Domain%20Controller%20Promotion%20in%20PowerShell,-Always%20from%20a&text=Enter%20the%20password%20of%20the,Wait%20during%20the%20promotion%20operation%20%E2%80%A6)[.](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#:~:text=Domain%20Controller%20Promotion%20in%20PowerShell,-Always%20from%20a&text=Enter%20the%20password%20of%20the,Wait%20during%20the%20promotion%20operation%20%E2%80%A6.)

<header aria-label="Content" class="entry-header" id="bkmrk-active-directory%3A-ad"># Active Directory: Add a Domain Controller to PowerShell

</header><div class="entry-content" id="bkmrk-table-of-contents-in" itemprop="text"><div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1 uagb-block-13c30eb4-8ce5-473a-9c10-276e7f025031 script-init" data-offset="30" data-scroll="1"><div class="uagb-toc__wrap"><div class="uagb-toc__title">Table Of Contents</div><div class="uagb-toc__list-wrap">1. [Introduction](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#introduction)
2. [Prerequisites](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#prerequisites)
3. [Installing the ADDS role in PowerShell](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#installing-the-adds-role-in-powershell)
4. [Domain Controller Promotion in PowerShell](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#domain-controller-promotion-in-powershell)
5. [Complements](https://247-it.io/en/active-directory-add-a-domain-controller-to-powershell/#complements)

</div></div></div></div>## <span class="uag-toc__heading-anchor" id="bkmrk-"></span>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.](https://247-it.io/ajouter-un-controleur-de-domaine-ad-ds-dans-un-domaine-existant/) (fr)

Adding a domain controller to PowerShell is done in two command lines, which saves time….

## <span class="uag-toc__heading-anchor" id="bkmrk--1"></span>Prerequisites

On the server that is going to be promoted domain controller, it is necessary:

<div class="entry-content" id="bkmrk-a-fixed-ip-address.-" itemprop="text">- 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.

</div>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](https://247-it.io/active-directory-configuration-multi-sites-sous-reseau-et-replication/).

## <span class="uag-toc__heading-anchor" id="bkmrk--2"></span>Installing the ADDS role in PowerShell

From a Powershell command prompt launched as administrator enter:

```
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
```

<div class="entry-content" id="bkmrk--3" itemprop="text"><figure class="wp-block-image size-rdrit-600">[![Install ADDS role in powershell](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-01-install-role-600x111.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure></div>Wait during the installation ….

<div class="entry-content" id="bkmrk--4" itemprop="text"><figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-02-install-role.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>
- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-03-install-role.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>
- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-04-install-role.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>

</figure></div>The AD DS role is installed:

<div class="entry-content" id="bkmrk--5" itemprop="text"><figure class="wp-block-image size-rdrit-600">[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-05-install-role-600x230.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure></div>## <span class="uag-toc__heading-anchor" id="bkmrk--6"></span>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.

<div class="entry-content" id="bkmrk--7" itemprop="text"><figure class="wp-block-image size-rdrit-600">[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-06-promote-dc-600x218.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure></div>Wait during the promotion operation ….

<div class="entry-content" id="bkmrk--8" itemprop="text"><figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-07-promote-dc.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>
- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-08-promote-dc.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>
- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-09-promote-dc.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>

</figure></div>After the operation completes, the following message appears and the server restarts.

<div class="entry-content" id="bkmrk--9" itemprop="text"><figure class="wp-block-gallery columns-2 is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-10-promote-dc.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>
- <figure>[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-11-promote-dc.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure>

</figure></div>At reboot the server is domain control.

<div class="entry-content" id="bkmrk--10" itemprop="text"><figure class="wp-block-image size-rdrit-600">[![](https://247-it.io/wp-content/uploads/2019/12/add-dc-in-domain-12-dc-promoted-551x400.png)](https://static.rdr-it.com/images/rdr-img-message.png)</figure></div>## <span class="uag-toc__heading-anchor" id="bkmrk--11"></span>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:

<div class="entry-content" id="bkmrk-install-addsforest%C2%A0%3A" itemprop="text">- [Install-ADDSForest](https://docs.microsoft.com/en-us/powershell/module/addsdeployment/install-addsforest?view=win10-ps) : which is used for creating a new Active Directory forest.
- [Install-ADDSDomain ](https://docs.microsoft.com/en-us/powershell/module/addsdeployment/install-addsdomain?view=win10-ps): which is used to create a domain in an Active Directory forest ([adding a child domain](https://247-it.io/en/active-directory-how-to-set-up-a-child-domain/)).
- [Install-ADDSDomainController](https://docs.microsoft.com/en-us/powershell/module/addsdeployment/install-addsdomaincontroller?view=win10-ps) : which is used to add an Active Directory domain controller to an existing domain.

</div><footer aria-label="Entry meta" class="entry-meta" id="bkmrk--12"></footer>