Active Directory Setup

To set up Active Directory properly, I recommend following this blog.

In DC1, we will change its IP address to a static one: 192.168.126.155. In the sfconfig panel, select option 8, then choose the number corresponding to the interface. The following steps will be shown below.

Make sure your default gate way is in this format XXX.XXX.XXX.2. You can double check by using this command line

ipconfig /all

Now, we will change the DNS server and set it to our static IP address. In the sfconfig panel, select option 8 again, then choose option 2. The following screen will be shown in the image below.

Now we will install the Active Directory in DC1. We will use these command lines below


powershell
install-windowsfeature AD-Domain-Services-IncludemanagementTools
import-Module ADDSDeployment
install-ADDSForest

Enter your Domain name

After this, DC1 will restart, and the DNS value will be reset to its default. Therefore, we need to change the DNS value again.

Now the Active Directory is installed on the project.

NOTE: Because we changed the IP address of the DC1, we need to set the value of the trust host value in Management client machine to the new IP address


Set-Item WSMan:\localhost\Client\TrustedHosts -Value '192.168.126.155'
Get-Item WSMan:\localhost\Client\TrustedHosts

We can check if the remote connection via WinRM is working after setting the trust host value. To do this, we will follow these commands:


New-PSSession -ComputerName 192.168.126.155 -Credential (Get-Credential)
Enter-PSSession 1

Last updated