Installing Active Directory on Server Core is not a task that can be achieved using  the Optional Component Setup tool--instead we actually have to use DCPROMO from the command line. Here's how to do it.

Note: this is part of our ongoing series teaching IT administration basics, and might not apply to everybody.

Before we install Active Directory there are a few things that need to be done first--we need to set static IP information for the network adapter as well as change the name of our server. This all needs to be done from the command line, so lets take a look at how to go about doing these tasks.

Setting a Static IP Address

Active Directory requires that the Server has a static IP assigned, so we need to get a list of the network adapters attached to this server. To do this we use a netsh command:

netsh interface ipv4 show interface

sshot-1

Now that you can see the names of all the network cards in your machine, you can change the settings for a specific card. To change the IP address we again use the netsh command:

netsh interface ipv4 set address name="Local Area Connection" source="static" address="10.10.10.1" mask="255.255.255.0" gateway="10.10.10.254"

Where the following values should be substituted:

  • Name – Name of the interface that you wish to change the settings for
  • Address – IP address that you want to assign the interface
  • Mask – The subnet mask for the interface
  • Gateway – The default gateway for the interface
sshot-15

To set up DNS information for the server, we run the following command:

netsh interface ipv4 add dnsservers name="Local Area Connection" address="127.0.0.1" index=1 validate=no

Where the following values should be substituted:

  • Name – Name of the interface that you wish to change the settings for
  • Address – IP address of the DNS Server (we are using the loopback address)
  • Index – Specify 1 to set the Primary DNS Server, Specify 2 to set the Secondary DNS Server
sshot-16

Changing The Computer Name

We would also want to rename the server before promoting it to a domain controller, to do that we use the netdom command. You should substitute DC1 in the following command, to whatever you want to call your server.

netdom renamecomputer %computername% /newname:DC1

sshot-17

For the changes to take effect you need to reboot your PC, to do this from the command line run the following command:

shutdown /r /t 0

Installing Active Directory

There is a couple of ways to install Active Directory on a Server Core, however we will go with the answer file method. So I have created an answer file (seen in the screenshot below) this is a basic answer file but if you have special needs you should see  this TechNet article which will give you a full list of parameters. You can create a file exactly like this in notepad and  just call it DCPROMO.txt

sshot-18

So what does this do:

  • Creates a new domain at the root of a new forest called howtogeek.local
  • Sets the forest functional level to Server 2008 R2
  • Installs DNS with an Active Directory Integrated Zone
  • Makes this sever a Global Catalog
  • Sets the AD Restore Mode password to Pa$$w0rd
  • Reboots on completion

You use the answer files by running the following command:

dcpromo :/unattend:”path to answer file”

sshot-19

This will kick off the installation of Active Directory and reboot on completion.

sshot-20

That’s all there is to installing Active Directory on Server Core.

Managing Active Directory

The easiest way to manage a Server Core Server is to use the RSAT (Remote Server Administrator Tools) which allows you to load up MMC consoles on any Windows 7 machine and connect to an instance of the role running on the server. You can grab the RSAT from here. The installation is in the form of a Windows Update, once installed open the Turn Windows features on or off option from the Programs and Features section in Control Panel. You need to add the AD DS Snap-ins and Command-line tools, check the screenshot to see how to get there.

sshot-21

Once the components have been added, you can open a run box by hitting the Windows + R key combination and type MMC before hitting enter.

sshot-22

This will open a blank MMC console, click on file and then choose Add/Remove Snap-in..

sshot-23

Choose Active Directory Users and Computers from the list and hit the Add button.

sshot-24

If you are logged in with a Domain Admin account, it will automatically connect to the Active Directory instance, if not you will have to connect to it manually.

sshot-25