How to promote new Domain Controler using Power Shell in Windows 2012

Powershell provide us 3 cmdlets to promote new domain conroller in AD:

  • Install-ADDSDomainController – Creates a new domain controller in an existing domain
  • Install-ADDSDomain – Creates a new domain in an existing forest
  • Install-ADDSForest – Creates a new forest

Prerequisites

As prerequisites we need to install windows features (roles) into our Windows 2012 R2 server core installation:

After login as local administrator type powershell to run powershell environment. Now we want to install server role (feature) that is responsible for Active Directory domain controler. Let’s type:
Get-WindowsFeature –Name *Domain*  List of avaliable cmdlets with Domain in name

To install new feature we type:
Install-WindowsFeature -Name AD-Domain-Services

Installation Domain Controller Feature Verify if Exit code is Success

Then We should test if we meet prerequirements to create new Forrest
Test-ADDSForestInstallation

test-addsinstallation

We will be asked to provide new Forrest name (DomainName) – in my case it is test.int, then we will be asked for Safe Mode Administrator Password in my case it is: **********install-addsforrest

In my case netwrok configuration was missing. To get more knowledge how to configure network interfaces using powershell see my article:
How to assign IP address to network interface using powershell

Ok, if everything is fine, we can proceed to Promote our AD Controller (Forest)

Install-ADDSForest

install-addsforrest1
After that new forest is completed, after reboot you can login to new domain forrest!

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

1 × three =