I’ve found myself using Windows Server 2008 Core quite a lot recently, and apart from using the GUI CoreConfigurator I’ve realised that I’m often completely forgetting a whole bunch of commands related to Server Core setup. Now nine times out of ten I’m working from a prepared Sysprep image with Group Policies setting everything I need; but every so often I forget or am setting up a test lab and need these commands. Anyways, here’s a list of codes that I use very often.
Updated: rearranged code as joining a domain switches the Windows Firewall profile; all firewall changes will be discarded if you make them before joining the domain. Found that out the hard way =)
Give the computer a sensible name
	
	
	
		
Then reboot for it to take effect
	
	
	
		
List network interfaces currently connected
	
	
	
		
Set up static primary IP address if needed
	
	
	
		
If you're in a cluster, tell the cluster NIC not to register itself in DNS
	
	
	
		
Join our server to our domain
	
	
	
		
and reboot once again
	
	
	
		
Open firewall ports for remote administration
	
	
	
		
	
	
		
And allow ICMP Echo for all firewall profiles
	
	
	
		
Enable remote connection to the Virtual Disk service
	
	
	
		
Let's enable Terminal Services so we can sit at our desk rather than in a server room
	
	
	
		
Reboot the server to make sure this takes effect - may not be necessary here
	
	
	
		
Confirm regional settings
	
	
	
		
Turn off Windows Update auto update
	
	
	
		
Enable WinRM
	
	
	
		
Install your Roles
	
	
	
		
Whack in your product key and license your server
	
	
	
		
Just to check it's actually taken effect...
	
	
	
		
Log off and your server is in production!
	
	
	
		
This is enough to put your server into production and manage it comfortably from your desk, rather than the server room.Advertisement
								Updated: rearranged code as joining a domain switches the Windows Firewall profile; all firewall changes will be discarded if you make them before joining the domain. Found that out the hard way =)
Give the computer a sensible name
		Code:
	
	netdom RenameComputer [i]<hostname>[/i] /NewName [i]<new_hostname>[/i]
	
		Code:
	
	shutdown /r /t 0
	
		Code:
	
	netsh interface show interface
	
		Code:
	
	netsh interface ipv4 set address “Local Area Connection†static [i]<IP address>[/i][i]<Subnet Mask>[/i] [i]<Default Gateway>[/i]
netsh interface ipv4 set dnsserver “Local Area Connection†static [i]<DNS IP Address 1>[/i] primary
netsh interface ipv4 add dnsserver “Local Area Connection†[i]<DNS IP Address 2>[/i] index=2
	
		Code:
	
	netsh interface ipv4 set dnsserver [i]<Cluster NIC>[/i] static none none
	
		Code:
	
	netdom join [i]<hostname>[/i] /domain:[i]<full DNS domain name>[/i] /userd:<user with rights to add to domain> /passwordd: *
	
		Code:
	
	shutdown /r /t 0
	
		Code:
	
	netsh advfirewall firewall set rule group="Remote Administration" new enable=yes
netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes
	
			this last command has to be run on both the Core installation And the server/workstation managing it
		
		
	
		Code:
	
	netsh firewall set icmpsetting 8 enable all
	
		Code:
	
	sc config vds start=auto
net start vds
	
		Code:
	
	cscript c:\windows\system32\SCregEdit.wsf /ar 0
	
		Code:
	
	shutdown /r /t 0
	
		Code:
	
	control timedate.cpl
control intl.cpl
	
		Code:
	
	cscript SCregEdit.wsf /AU 1
Net stop wuauserv
	
		Code:
	
	WinRM quickconfig
	
		Code:
	
	start /w ocsetup [i]<your role here>[/i]
	
		Code:
	
	start /w slmgr.vbs -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
start /w slmgr.vbs -ato
	
		Code:
	
	start /w slmgr.vbs -dli
	
		Code:
	
	logoff