build, to a dc running a brand new domain. I figured out a set of commands that achieve this, so thought I would share them with the world.
Rename the Host
Netdom renamecomputer <OldName> /NewName:<NewName>
Netdom computername [origcomputername] /add Core.contoso.com
Netdom computername [origcomputername] /makeprimary core.contoso.com
See all the network adaptors
Make a note of the number shown in the Idx column of the output for your network adapter. If your computer has more than one network adapter, make a note of the number corresponding to the network adapter for which you wish to set a static IP address.
netsh interface ipv4 show interfaces
IP Address
netsh interface ipv4 set address name="<ID>" source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>
netsh interface ipv4 set address name="<ID>" source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>
DNS Address
netsh interface ipv4 add dnsserver name="<ID>" address=<DNSIP> index=1
netsh interface ipv4 add dnsserver name="<ID>" address=<DNSIP> index=2
Disable the Windows Firewall
netsh firewall set opmode mode=disable
Enable RDP Access
cscript C:\Windows\System32\Scregedit.wsf /ar 0
If you are using an older version of TS client, then you need to drop the security levels on core:
cscript C:\Windows\System32\Scregedit.wsf /cs 0
Activation
start /w slmgr.vbs -ipk 7PGF4-P7GJP-FDVWM-RB93X-9XXPX
Check Activation
start /w slmgr.vbs –ato
Enable Automatic Updates
cscript C:\Windows\System32\Scregedit.wsf /AU 4
To use the Disk Management MMC snap-in remotely
Net start vds
Install DNS Role
start /w ocsetup DNS-Server-Core-Role
Join Domain
netdom join ComputerName /domain:DomainName /userd:UserName /passwordd:*
Create New Domain Controller
dcpromo /unattend:c:\unattend.txt
Unattend.txt Contents
[DCINSTALL]
InstallDNS=yes
NewDomain=forest
NewDomainDNSName=itdata.local
DomainNetBiosName=itdata
SiteName=Home
ReplicaOrNewDomain=domain
ForestLevel=4
DomainLevel=4
DatabasePath=%systemroot%\NTDS
LogPath=%systemroot%\NTDS
RebootOnCompletion=yes
SYSVOLPath=%systemroot%\SYSVOL
SafeModeAdminPassword=Passw0rd
Forest Level
Specifies the forest functional level when you create a new forest. A value of 0 specifies Windows 2000. A value of 2 specifies Windows Server 2003. A value of 3 specifies Windows Server 2008. A value of 4 specifies Windows Server 2008 R2.
The default forest functional level in Windows Server 2008 when you create a new forest is Windows 2000 (0).
The default forest functional level in Windows Server 2008 R2 when you create a new forest is Windows Server 2003 (2).
Do not use this parameter when you install a domain controller in an existing forest.
Domain Level
Specifies the domain functional level during the creation of a new domain. A value of 0 specifies Windows 2000. A value of 2 specifies Windows Server 2003. A value of 3 specifies Windows Server 2008. A value of 4 specifies Windows Server 2008 R2.
The domain functional level cannot be lower than the forest functional level, but it can be higher.
The default is automatically computed and set to the existing forest functional level or the value that is set for /ForestLevel.
http://technet.microsoft.com/en-us/library/cc732887%28WS.10%29.aspx
kantoormeubilair
Windows Server 2008 R2 Server Core unattended setup from command line | Marc Kean