A few commands to get started with Windows Server Core

This content is 17 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

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

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

8 thoughts on “A few commands to get started with Windows Server Core

  1. 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 to
    (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).

  2. 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:

    • Change the computer name before joining a domain:

      netdom.exe renamecomputer %computername% /NewName:newcomputername

    • Change the computer name after joining a domain:

      netdom.exe renamecomputer %computername% /NewName:newcomputername /userd:domainname\username /passwordd:*

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

  4. Another useful tip is how to enable automatic updates:

    Windows 2008 Server Core uses the SCregEdit.wsf script found in C:\Windows\System32 to configure Automatic Updates behavior.

    To view the current Automatic Updates settings, from the command prompt type:

    c:\windows\system32\scregedit.wsf /AU /v

    The following values correspond to the response generated by the scregedit.wsf script.

    1 = Automatic Updates Disabled
    4 = Automatic Updates Enabled

    To enable Automatic Updates, from the command prompt type:

    c:\windows\system32\scregedit.wsf /AU 4

    To disable Automatic Updates, from the command prompt type:

    c:\windows\system32\scregedit.wsf /AU 1

    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.

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


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.