Quantcast
Channel: Active Directory – azurecurve
Viewing all articles
Browse latest Browse all 23

PowerShell to Promote Domain Controller

$
0
0

Windows ServerWhen testing Microsoft Dynamics GP, I often need a domain controller within my set of virtual machines. I’ve been promoting a server to be a domain controller manually, but it recently occurred to me that I could probably do the same task using PowerShell.

After doing some research, I came up with four commands which will rename and restart the server, install the Active Directory feature and add a forest.

To rename a server, run the following command, replacing the highligted section with the new server name:

Rename-computer -newname {server name}

After renaming a server, it needs to be rebooted; the following command will do this:

Restart-Computer

The Active Directory Domain Services Windows Feature need to be installed:

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

The final step in promoting the server to be a domain controller, is to add the forest.

There are two elements which need to be defined:

  1. Domain name (such as azurecurve.local)
  2. NETBIOS (such as AZRCRV)
Install-ADDSForest -DomainName {domain name} -DomainNetbiosName {netbios}

With the four commands run, the promotion to domain controller will be complete.

(Visited 196 times, 1 visits today)

Viewing all articles
Browse latest Browse all 23

Latest Images

Trending Articles





Latest Images