Make a server a Domain Controller
New domain and forest.
To make a windows server a DC (domain controller) you must first install the feature. I first use the get-WindowsFeature to see if the correct feature is targeted.
1 |
get-WindowsFeature ad-domain-services | Install-WindowsFeature –IncludeManagementTools |
After the feature is installed, load the correct module and install the servers as a Domain controller for a new domain and forrest.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Import-Module ADDSDeployment Install-ADDSForest ` -CreateDnsDelegation:$false ` -DatabasePath "C:\Windows\NTDS" ` -DomainMode "Win2012R2" ` -DomainName "test.internal" ` -DomainNetbiosName "TEST" ` -ForestMode "Win2012R2" ` -InstallDns:$true ` -LogPath "C:\Windows\NTDS" ` -NoRebootOnCompletion:$false ` -SysvolPath "C:\Windows\SYSVOL" ` -Force:$true |
Existing domain and forest.
I you have already a domain and forest up and running you must add a server to this domain.
1 2 |
Install-WindowsFeature -Name ad-domain-services Install-ADDSDOmainController -DomainName test.internal -Credential (Get-Credential test\administrator) |
Demote a server.
To remove the domain controller function from a server use.
1 |
uninstall-ADDSDomainController |
Use the get-help with this cmdlet to see the options you can use.