DCSIMG
October 2006 - Posts - Windowmaker's blog

October 2006 - Posts

So you have Server Core installed. You have configured the clock, time zone and want to continue those basic tasks you are accustomed to perform when you build a new server. Now when I build a new server, what I usually do is to:

  1. Enable Remote Desktop so I can administer the server from remote
  2. Configure Automatic Updates and install the latest patches
  3. Reconfigure the default Pagefile settings

So if we were talking about "normal" Windows server (you know - the one with GUI, wizards, bells and whistles…), you would be done with that before I finish this sentence, but how do you do those tasks in Server Core ?
Well, apparently Microsoft folks already thought about it and have added a script (SCregEdit.wsf)
to perform the tasks mentioned above.


 Side note: in Server Core (at least on build 5600) the default scripting host from some reason is WScript. If you ask me, that is quite annoying as the whole concept of the system is about avoiding work with windows or anything related to GUI. For you convenience you might want to consider switching to CScript as your default scripting host in order to avoid popups (wscript.echo or other methods) and direct the output to console. You can do it by executing the following command:

C:\Windows\System32>cscript //H:CScript //NOLOGO //s
Command line options are saved.
The default script host is now set to "cscript.exe".


Terminal Service Remote Administration Connections:

 

To view current settings:

C:\Windows\System32>cscript SCregEdit.wsf /AR /v
System\CurrentControlSet\Control\Terminal Server fDenyTSConnections
View registry setting.
1

If you see "1" in the script output, that means that TS connections will be denied. To change that you need to execute:

C:\Windows\System32>cscript SCregEdit.wsf /AR 0
Registry has been updated.

C:\Windows\System32>cscript SCregEdit.wsf /AR /v
System\CurrentControlSet\Control\Terminal Server fDenyTSConnections
View registry setting.
0

Now you can open an RDP session to your Server Core box and start administering it from remote.

 

 

Managing Automatic Windows Updates

 

To view your current Automatic Updates settings:

C:\Windows\System32>cscript SCregEdit.wsf /AU /v
SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update AUOptions
Value not set.

 

As you can see, by default the automatic updates are not configured. In order to configure the AU you have to set the /AU value to one of the following:

/AU [/v][value]

        /v      View the current Automatic Update settings
        value   value you want to set to.

        Options:
        4 - Enable Automatic Updates
        1 - Disable Automatic Updates

i.e. in order to enable automatic updates you would execute:

C:\Windows\System32>cscript SCregEdit.wsf /AU 4
Registry has been updated.

Managing server pagefile settings:

/PF [/v] [minValue] [maxValue]
/v View the current PageFile settings
minValue Minimum Value of the page file size
maxValue Maximum value of the page file size

To view your current settings:

C:\Windows\System32>cscript SCregEdit.wsf /PF /v
SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management PagingFiles
View registry setting.
?:\pagefile.sys

To configure the pagefile to minimum of 512MB and maximum of 1GB:

C:\Windows\System32>cscript SCregEdit.wsf /PF 512 1024
Registry has been updated.

C:\Windows\System32>cscript SCregEdit.wsf /PF /v
SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management PagingFiles
View registry setting.
c:\pagefile.sys 512 1024

 

Time to bed... Roger and out.

Ok... so we do not have Control Panel in the Start menu (hey! there is no Start menu!), so what do we do ?
The thing with Core is that despite it's lack of the nice interface, it is still capable of running some GUI based applications. What we do know though is that all those Control Panel applets were actually files with CPL extension that were launched using control.exe program. So let's poke around and see if we can find any of those in Core:
 
 
Not much, right ? So let's try executing those.
Typing "c:\windows\system32\intl.cpl" at the command prompt brings up somewhat familiar dialog:
 
 
Now this is something we can work with. Living in Israel, one of the first things I do when I configure a server is to add the Hebrew keyboard support. In Longhorn this is done by going to "Keyboards and Languages" tab and clicking the "Change Keyboards" button. One good thing I have noticed is the fact that in Longhorn you do not need to check this "Install files for complex script and right-to-left languages" checkbox to make Hebrew available as keyboard layout. Just click the "Add" button, scroll down and choose Hebrew:
 
 
Couple notes while on topic:
 
1) When configuring keyboards and going to the "Language Bar" tab, you will see options that, though available, not work on the Core (well, you can't dock the language bar in the taskbar as there is no taskbar ;) ). I guess this will be fixed in future builds. But if you want an indicator of currently selected language, you can select "Language Bar: Floating on Desktop" and it will happily show it for you (see screenshot below).
 
2) Clicking "Install/Uninstall languages" under "Keyboards and Languages" tab results in a nasty error dialog (not sure whether this option should even exist in the Core):
 
 
Well, enough with the language settings. Let's set the system clock and timezone. Typing at the command prompt: "c:\windows\timedate.cpl" brings up the dialog that I guess you can handle on your own ;) :
 
 
Notice for Israel residents: Longhorn comes pre-configured for Jerusalem timezone with daylight settings till year 2023 ! You do not need to update the servers with daylight settings. This is achieved by a change in how the daylight settings are stored in the registry: till now the registry stored only the beginning and the end of summer clock and those settings were applied for every consecutive year. In Longhorn there are seperate registry settings for each upcoming year till 2023:
 
 
Enough for today...
So I have finally freed some time to give a shot to the long awaited Longhorn Server Core.
"Server Core? What the hell?" - one might ask. Well, if you have not heard about it, this is where all those Unix SysAdmins will shrug and will give you one of those "yeh, right!" looks. We are talking here about a cut-down version of server OS that comes without all those GUI bells and wistles. When you are done with the installation, all you have is a command prompt. Cool!
To save myself the explanations, I'll just quote from Windows Server Code Name "Longhorn" Product Overview:
 
Server Core: Beginning with the Beta 2 release of Windows Server "Longhorn," administrators can choose to install Windows Server with only the services required to perform the DHCP, DNS, file server, or domain controller roles. This new installation option will not install non-essential services and applications and will provide base server functionality without any extra overhead. While the Server Core installation option is a fully functioning mode of the operating system supporting one of the designate roles, it does not include the server graphic user interface (GUI). Because Server Core installations include only what is required for the designated roles, a Server Core installation will typically require less maintenance and fewer updates as there are fewer components to manage. In other words, since there are fewer programs and components installed and running on the server, there are fewer attack vectors exposed to the network, resulting in a reduced attack surface. If a security flaw or vulnerability is discovered in a component that is not installed, a patch is not required.
 
So I logged on to my MSDN account and downloaded the 5600 build. Not having free hardware to spare for the task I created a virtual machine in Virtual Server 2005 R2 and as I was planning to install the "GUI-less" version, I took quite opportunistic decision to give it only 256MB of RAM (ok...ok... so I did not read the hardware requirements first) and after the first screen was nicely informed that the installation requires at least 512MB of RAM. Quite irritating if you ask me, considering that the OS is not planned to run GUI applications.
Anyway, I reconfigured the virtual machine with 512MB and restarted the installation, during which I was presented with the following screen:
 
 
After several additional screens I was finally presented with the logon screen that to my surprise was almost identical to Vista's look:
 
 
Now here the things get interesting... Entering the password all I got was the following:
 
 
Wow ! We have ended up with a server without Explorer, no IE and no GUI wizards to help us configure it ? Frightening thought... But do not let this scare you. In the next posts I will show you how to perform some basic things you were used to do in GUI using the "Core-way" ;)
 
Till next time...