Quoting Scotty McLeod:
Mark mailed me last night to ask about my crib sheet for Core Server but as it was Friday evening was taking a rest from the digital world. A hour and a half later he mailed me back to say he had found all he needed.
Now this was from the mail Mark’s first real go in anger at installing and configuring Core Server but we have to remember he is an great Windows professional and old enough to have used command lines for a significant proportion of his life with computers.
I’m honoured that Scotty refers to me as a professional but somewhat concerned at the same time that my age (I’m only 35!) is linked with command line usage. Actually, I think it’s got more to do with geekiness and although I can’t confess to being a Linux/Unix expert, I do love diving into a command shell. I guess what Scotty is saying is that I’m old enough to have cut my teeth in the computing world before GUIs were the norm – and he’s right.
Anyway, back to Server Core. I love it. I hate it. No, I love it. Well, I love the idea and I’m sure I will love using the product but, because it’s not yet finished, the administration of a Server Core box can be a chore. Consequently, here’s my checklist of tasks from when I needed to get a Server Core box up and running last Friday (based on the June CTP build).
- Enable remote desktop (from a Windows Vista client):
cscript %windir%\system32\SCRegEdit.wsf /ar 0
- Change the machine name:
netdom renamecomputer %computername% /newname:newcomputername
- Set the IP address for the primary NIC:
netsh interface ipv4 set address "Local Area Connection" ipaddress subnetmask gatewayipaddress
- Set the DNS server addresses:
netsh interface ipv4 add dns "Local Area Connection" ipaddress [index=indexnumber]
- Disable the firewall (at least until everything is working):
netsh firewall set opmode disable
- Join a domain:
netdom join %computername% /domain:domainname /userd:domainname\username /passwordd:*
- Restart the server:
shutdown -r
- Change the drive letter allocation for an existing disk (e.g. the CD-ROM drive):
diskpart
select volume volumenumber
assign letter=driveletter - Format additional disks (in my case, these had been partitioned during setup but additional
diskpart.exe
commands could be used):
diskpart
select disk disknumber
select partition partitionnumber
format fs=ntfs label="volumelable" quiet
- Label a disk (e.g. the system disk):
label driveletter: "volumelable"
- Add a domain user to a local group (note that there are some serious restrictions around this – Microsoft knowledge base article 324639 has more details):
net localgroup groupname /add domainname\username
This has just scraped the surface with a few commands that I needed – it would have taken me a lot longer to write this post without these excellent resources:
- Administering IIS 7 on Server Core installations of Windows Server 2008 (including IIS deployment and configuration tips and Server Core administration tips).
- Creating a core Longhorn server.
- Getting started with Server Core.
Other links that may be useful include the Windows command line reference and my own post on using netsh
to set multiple DNS server addresses.
Some more tips (from J Greg’s Brain Corral):
Allow remote desktop through the firewall (instead of disabling it!):
netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
Change the console screen resolution:
Run
regedit.exe
and navigate toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{BBF118A6-4C44-4FE4-A8A3-965A9A577F98}0000
(or whichever GUID key has a subkey named VolatileSettings with a value of 0000), then change DefaultSettings.XResolution and DefaultSettings.YResolution to the desired values (in decimal format).
Another useful command relates to activating Windows (via Ben Armstrong):
cscript %windir%\system32\slmgr.vbs -ato
Ben also used a slightly different variation on the shutdown command to make the restart occur immediately:
shutdown -r -t 0
He also notes that the command to rename a computer will vary according to whether or not it is domain joined:
netdom.exe renamecomputer %computername% /NewName:newcomputername
netdom.exe renamecomputer %computername% /NewName:newcomputername /userd:domainname\username /passwordd:*
I’m not sure if I made a mistake when I originally wrote this post, or if there has been a change in the RTM version of Windows Server 2008 but in order to set the IP address for the primary NIC I needed to change the command above slightly:
netsh interface ipv4 set address "Local Area Connection" static ipaddress subnetmask gatewayipaddress
Another useful tip is how to enable automatic updates:
Also, some advice from Julie Smith on enabling remote desktop – the /ar switch for scregedit.wsf is only for Vista and Windows Server 2008 client access – the /cs switch is required to allow access from legacy RDP clients.
I haven’t even read the rest of the article yet (just the beginning comments) and just had to post this down here! My name is also Mark and I too have just had a run at installing Server Core! Whew! I grew up with an 8088 IBM PC XT clone, then a PC Jr., then a 286/386/486/486 DX/486 DX2 and then in my senior year of high school I plopped down $800 for a Pentium 100!
So I’m not far behind the “old guy” Mark here (I’m 29) and I have to admit that having grown up with command prompts has proved quite valuable for this install. I prefer GUI’s anyday, but there are always things that are just easier done in a CLI. Or in some cases, can only be done in a CLI (such as ping & arp).
Anyways, I just wanted to share how sympathetic I am to you Mark- finally getting what I needed in Server Core done took me over a week to piece together! I still have a few other issues to work out, but it’s only a Hyper-V host so with that up and running I can move-on to an MMC and install GUI OS’s.
~Mark