Windows Server Core notes

Initial setup tasks

(some commands taken from Sander Berkouwer: How to install a Server Core R2 Domain Controller)

For most tasks, you can use sconfig.cmd. But, if you’re not running Server Core, or you just want to know how to do it yourself, here are some examples in no particular order:

In addition, cscript scregedit.wsf /cli shows some other useful commands.

Server role / feature configuration

Domain controller

To promote the machine to be a domain controller (in this example, in a new forest):

dcpromo /NewDomain:forest /NewDomainDNSName:deep6.test /ReplicaOrNewDomain:domain /InstallDNS:yes /SafeModeAdminPassword:hunter2

You could instead create an answer file for unattended installation:

[DCInstall] 
NewDomain=forest
NewDomainDNSName=deep6.test
ReplicaOrNewDomain=domain
InstallDNS=Yes
SafeModeAdminPassword=hunter2

And then run:

dcpromo /unattend:unattend.txt

Server / domain administration

Active Directory

The ‘easiest’ way to do command-line administration of AD is probably with the ds* commands. Here are some examples to get you started:

If you’re feeling penitent, here are some wmic commands instead:

Unfortunately it’s not possible to use wmic to set user properties; the Active Directory (DS) WMI Provider has a quirky way of updating properties.

DNS

dnscmd.exe is the usual command-line utility for DNS management.