No Scripts, Ma! Install a Parent and Child Domain with Server Core 2012 R2

Jenny Ng
Tech Jobs Academy
Published in
4 min readJul 12, 2016
Child domain successfully created and connected to the parent.

When you don’t have a scripting environment or a GUI, you can use two command-line tools within Server Core, i.e. PowerShell and sconfig, to do configurations. And while PowerShell can do everything on its own, it’s sometimes better to rely on sconfig, which is more straightforward and involves less typing. This is why I recommend using both.

The first thing you see when you load up Server Core is the cmd window. PowerShell can be accessed from cmd by typing “powershell”. To exit PowerShell, type “exit” and you’ll be back in cmd.

See the “PS” on the bottom left corner? That’s how you know you’re using PowerShell.

To switch to sconfig, just type “sconfig” at the cmd line. Sconfig lets you make quick changes in a server, to a server. And it will show up as a window with a blue background.

Type “sconfig” and hit Enter to launch sconfig.
Welcome to sconfig. Step right up and pick a number!

Note: All PowerShell cmdlets here are highlighted in bold.

Getting the Parent ready

In PowerShell on your host machine, run the following commands (adjust names and paths to suit your machine):

  1. Create a virtual machine named ROOT-DC and a vhd named Parent.
    New-VM –Name ROOT-DC –MemoryStartupBytes 2048MB –NewVHDPath “c:\Parent.vhd” –NewVHDSizeBytes 64GB
  2. Create a private switch called Whatever.
    New-VMSwitch –Name Whatever –SwitchType Private
  3. Give ROOT-DC a network switch of Whatever.
    Connect-VMNetworkAdapter -VMName ROOT-DC –Switch Whatever
  4. Map ISO (i.e. Server 2012 R2 installation CD) to your VM.
    Set-VMDvdDrive -vmname ROOT-DC -Path “c:\WIN2012R2EVAL.iso”

Turn on your virtual machine. Follow the installation CD’s instructions to install Server Core. Next:

  1. In PowerShell, change the VM’s computer name to ROOT-DC. Your VM will force itself to restart. (Important: Before you restart your VM, remember to eject the installation CD!)
    Rename-computer -NewName ROOT-DC -Force –Restart
  2. After the server has restarted, switch from cmd to sconfig.
  3. In sconfig, choose “9) Date and Time”. This triggers a “Date and Time” GUI pop-up window. Remember to change the time zone too.
  4. In sconfig, choose “8) Network Settings” to configure IP and DNS.
sconfig says hi.

5. In sconfig, choose “15) Exit to Command Line”, then type “powershell”.

6. In PowerShell, run the following to install the Active Directory feature.
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools

7. In PowerShell, run the following to install your forest domain; we’re calling it tailspintoys.com.
Install-ADDSForest -DomainName tailspintoys.com

Getting the Child ready

  1. Repeat the Parent steps (1–4), but give this VM and its vhd new names. We’re going to use CORP-DC1 and “c:\Child.vhd”. Don’t forget to add the network switch. Then, install Server Core.
  2. In PowerShell, change your VM’s computer name to CORP-DC1. Your VM will force itself to restart. (Important: Before you restart your VM, remember to eject the installation CD!)
    Rename-computer -NewName CORP-DC1 -Force -Restart
  3. After the server has restarted, switch from cmd to sconfig.
  4. In sconfig, choose “9) Date and Time” a GUI pop-up window will let you adjust the date and time. Remember to change the time zone too.
  5. In sconfig, choose “8) Network Settings” to configure IP and DNS. Make sure the IP of the DNS is the same as on the parent (aka forest domain).
  6. In sconfig, choose “1) Domain/Workgroup” to join CORP-DC1 to the tailspintoys.com parent domain. You’ll be asked for the administrator username and password of the parent domain that you wish to join.
You’ll see this right before it asks for the password.

Congrats, your server is now joined to tailspintoys.com! But it needs a bit of independence from its parent. It can’t be considered a child domain yet, until it becomes a domain controller.

7. Return to PowerShell and install Active Directory to ready this server to become a domain controller.
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools

8. In PowerShell, promote your server to corp.tailspintoys.com, where “corp” will be the name of your child domain. The machine will restart.
Install-ADDSDomain -credential (get-credential tailspintoys\administrator) -NewDomainName corp -ParentDomainName tailspintoys.com

How do I know this worked?

Go to sconfig, find “1) Domain/Workgroup”, and “corp.tailspintoys.com” should be listed on the top right.

“corp” is the domain name we gave the child, and “tailspintoys.com” is the parent domain. I guess that makes you a domain grandparent. :)

--

--

Jenny Ng
Tech Jobs Academy

My technical blog for school. (With the occasional lit post.) See my Twitter for more info.