Server Core - first steps
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:
- Enable Remote Desktop so I can administer the server from remote
- Configure Automatic Updates and install the latest patches
- 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.