Installation of Active Directory Role on Windows Server 2019 using Powershell (Step by Step Instructions)

Active Directory can be installed using the GUI based tools available on the Windows Server by default like Server Manager or via Windows Admin Center (not installed by default). If you want to Install Windows Admin Center on Windows Server 2019, you can check out the post Windows Admin Center. There could be various reasons for installing the Active Directory role on Windows Server using Powershell e.g. Installation of AD on Server Core OS or Reducing the overall time to complete the installation or it could be when creating an AD installation documentation with less screenshots and more command based. In this post, I will show you the step by step instructions of installation of Active Directory on Windows Server 2019. These steps can be followed on Windows Server 2016 or Windows Server 2012 R2 as well.

STATIC IP Address ?

As a best practice Make sure the IP Address of the Server on which you are going to install Active Directory role is set to static. You can perform this step using GUI by going to Start -> Run -> type ncpa.cpl and Press Enter. This will show the NIC or Ethernet Adaptors Installed on your server. Right click on the relevant NIC Card and choose Properties and change the IP Address from DHCP to Static.

You can also use Get-NetIPAddress and New-NetIPAddress commands (if you do not want to use the GUI Method) to update the IP Address of the NIC Card and change it from DHCP to Static.

Installation Steps

Finding the AD Service Name

Now Let’s Start the Installation Process. First, Please check the Active Directory Service Name using the command as shown below. The Service Name we are looking for is AD-Domain-Services.

Installing Active Directory Domain Service

Now we have the AD service name with us, we can use it in our next command. Execute below command to install the Active Directory Role on the server.


Importing the Active Directory Modules (ADDSDeployment)

Whats in ADDSDeployment ?

Installation of First Domain Controller in a Forest

Use below commands to Configure the Active Directory we just installed in the previous step. These commands will set the domain name, AD Database Path, Domain Mode and Forest Mode etc. for your Active Directory. Please make sure you update the values in the parameters as per your requirement.


Now we need to run these commands to promote the server to Domain Controller and configure the Active Directory. You can use Powershell ISE or run it directly on the Powershell console as well. For Launching the Powershell ISE. Just type ise on the Powershell Prompt. When you execute the above lines of code, it will prompt you for SafeModeAdministratorpassword. This will be your Directory Services Restore Mode (DSRM) Password, Please keep the password secure as this is the password which you will use if you have to recover / repair the Active Directory Database.




After Reboot of the Server, Make sure below services are running.



Adding a Domain Controller in AD forest.


Leave a Reply

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