Tuesday, December 31, 2013

Promote the first domain controller in Server Core environment by PowerShell in Windows Server 2012 or later

In Windows Server 2012 or later, administrators can promote a domain controller by erforming some cmdlets in PowerShell console. Administrators might not perform cmdlets to deploy a domain controller in GUI environment. However, if a server is in server core environment, administrators have to perform PowerShell cmdlets to promote a server to a domain controller.

Goal
Promote a server which was installed Windows Server 2012 Server Core to the first domain controller in Active Directory forest. 

Prerequisites
  • A server named DC01
  • An IP address and preferred DNS server of DC01 is 192.168.4.11/24

Steps
1. On DC01, log in as local Administrator.
2. On "Command Prompt", perform "PowerShell" to enter PowerShell console.


3. Perform "Install-WindowsFeature AD-Domain-Services -IncludeAllSubFeature -IncludeManagementTools" to install features and management tools of Active Directory.


4. Perform "Test-ADDSForestInstallation -DomainName <Domain Name> -ForestMode Win2003 -DomainMode Win2003 -InstallDns" to run the prerequisite checks for installing a new Active Directory forest with Forest and Domain functional level at Windows Server 2003.


You have to enter a "SafeModeAdministratorPassword" for this test.

The "Status" of this test is "Success" so we can continue promoting a server to a domain controller.

Remark: Windows Server 2012 supports the following Forest and Domain functional level: Win2003, Win2008, Win2008R2 and Win2012 and Windows Server 2012 R2 supports: Win2008, Win2008R2, Win2012 and Win2012R2.


Remark: "Test-ADDSForestInstallation" and other related cmdlets are under "ADDSDeployment" module.


5. Perform "Install-ADDSForest -DomainName <Forest domain name> -DomainNetbiosNAme <NetBios Name> -ForestMode Win2003 -DomainMode Win2003 -InstallDNS" to promote the first domain controller in a new forest.


6. Enter a "SafeModeAdministratorPassword" for this domain controller.

Remark: "SafeModeAdministratorPassword" is applied to recover the domain controller when entering "Directory Services Restore Mode".

7. Press "Y" to continue promotion.


Then, the server started to promote a server to be a domain controller and then will restart automatically.



Remark: We can also add other parameters for "Install-ADDSForest" cmdlet to change the default log path and the default NTDS database path. For more information, please enter "Help Install-ADDSForest -Full".

8. After DC01 restarted, log in as Domain Administrator.
9. On "Command Prompt", perform "PowerShell" to enter PowerShell console.
10. Perform "Get-ADForest". 


As a result, DC01 has been promoted to the first domain controller.

This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment