How to install Server Core DCs.txt - Notepad

How to install Server Core DCs

Installing Active Directory Domain Services on Windows Server 2012 R2 Core and creating a Forest

#Step 1
Rename-Computer -NewName DC01
Restart-Computer -Force
Or just use sconfig.

#Step 2
New-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.2.2 -PrefixLength 24
Set-DNSClientServerAddress –InterfaceIndex 12 -ServerAddresses 192.168.2.2
Or just use sconfig.

#Step 3
Install-WindowsFeature -Name AD-Domain-Services

#Step 4
$Password = ConvertTo-SecureString -AsPlainText -String enter_password -Force
Install-ADDSForest -DomainName nickbeare.com -SafeModeAdministratorPassword $Password -DomainNetbiosName nickbeare -DomainMode Win2012R2 -ForestMode Win2012R2 -DatabasePath "%SYSTEMROOT%\NTDS" -LogPath "%SYSTEMROOT%\NTDS" -SysvolPath "%SYSTEMROOT%\SYSVOL" -NoRebootOnCompletion -InstallDns -Force

#Step 5
Restart-Computer -Force


Installing a Domain Controller on Windows Server 2012 R2 Core in an existing domain

#Step 1
Rename-Computer -NewName DC02
Restart-Computer -Force
Or use sconfig.

#Step 2
New-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.2.3 -PrefixLength 24
Set-DNSClientServerAddress –InterfaceIndex 12 -ServerAddresses 192.168.2.2

Or use sconfig.

#Step 3
Add-Computer -DomainName nickbeare -Credential (Get-Credential)
Restart-Computer -Force
Or use sconfig.

#Step 4
Install-WindowsFeature -Name AD-Domain-Services

#Step 5
$Password = ConvertTo-SecureString -AsPlainText -String enter_password -Force
Install-ADDSDomainController -DomainName nickbeare.com -DatabasePath "%SYSTEMROOT%\NTDS" -LogPath "%SYSTEMROOT%\NTDS" -SysvolPath "%SYSTEMROOT%\SYSVOL" -InstallDns -ReplicationSourceDC DC01.nickbeare.com -SafeModeAdministratorPassword $Password -NoRebootOnCompletion

#Step 6
Restart-Computer -Force

#View all the Domain Controllers
Get-ADGroupMember "Domain Controllers"


Some other useful commands

Create an AD user:
new-aduser username1

Set an AD user account's password:
set-adaccountpassword -identity username1

Enable an AD user account:
enable-adaccount -identity username1

Add user to domain admins group:
Add-ADGroupMember 'domain admins' username1

Show average CPU utilisation. If you are in console view you can do ctrl-alt-delete and bring up task manager.
get-wmiobject win32_processor | measure-object -property loadpercentage -average | select-object -property average

Remember to enable WinRM using sconfig so that you can connect to the DC using PowerShell (Enter-PSSession). You can also set automatic windows updates and do a manual update using sconfig.

After the above installation you can administer AD, DNS, Group Policy etc from a remote workstation which has the RSAT tools installed.