Mark's Windows Server Blog

Snippets of Windows Server information from Mark Wilson

A few commands to get started with Windows Server Core

Scotty wrote:

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).

  1. Enable remote desktop (from a Windows Vista client):
    cscript %windir%\system32\SCRegEdit.wsf /ar 0
  2. Change the machine name:
    netdom renamecomputer %computername% /newname:newcomputername
  3. Set the IP address for the primary NIC:
    netsh interface ipv4 set address "Local Area Connection" ipaddress subnetmask gatewayipaddress
  4. Set the DNS server addresses:
    netsh interface ipv4 add dns "Local Area Connection" ipaddress [index=indexnumber]
  5. Disable the firewall (at least until everything is working): netsh firewall set opmode disable
  6. Join a domain:
    netdom join %computername% /domain:domainname /userd:domainname\username /passwordd:*
  7. Restart the server: shutdown -r
  8. Change the drive letter allocation for an existing disk (e.g. the CD-ROM drive):
    diskpart select volume volumenumber assign letter=driveletter
  9. 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
  10. Label a disk (e.g. the system disk):
    label driveletter: "volumelable"
  11. 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: 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.