In this blog, I am going to install Active Directory in Microsoft Windows Server 2012 for the test server roles
Install Active Directory Server 2012
Requirements.
Administrator account has a strong password
Static IP is configured
Latest windows updates are installed
A firewall is turned off
Rename Computer (optional)
1- Open Server Manager from the taskbar.

2- From the Server Manager Dashboard and click on Add Roles and Features.

3- Click next.

4- Select a server from the server pool on which you would like to configure active directory and click on next.

5- Select a server from the server pool on which you want to configure active directory and click next.

6- Choose Active Directory Domain Services from the server roles page.

7- A Windows will popup be showing additional required features and click Add Features.

8- After adding features, click next.

9- Default settings, click next.

10- Review about Active Directory Domain Services and click Next.

11- Review the active directory domain services installation and then click Install.

12- Active directory Installation completed, so click close.

Configuring Windows Server 2012 Active Directory
13- From Server Manager click on Notifications, so click remote this server to a domain controller.

14- Under select the deployment operation Select Add a new forest enter the Root domain name and then click on Next.

15- Selection forest and domain functional level Windows Server 2012 as the default level. Keep Domain Name System (DNS) server checked and type the directory services restore mode (DSRM) password and then click next.

16- Ignore warnings in the DNS options window and then click next.

17- In the additional options window, verify the NetBIOS domain name and then click Next.

18- Specify the location of the AD DS database, log files, and SYSVOL folders and then click on Next.

19- In the review options window, review domain name, NetBIOS name, and Global catalog, etc. and then click on next

20- When all prerequisite has been successfully passing then click on Install.

21- When the installation completes, you will be prompt that your machine successfully configures as a domain controller and will be rebooted automatically.

For more information click here