I recently added a Windows Server Core 2008 server to my fleet of servers. There is a huge difference between Server and Server Core, and that difference is that Server Core doesn’t have a graphical user interface. Since most people who administer a Windows network are used to a point and click environment, I wanted to share some quick tips on some command line administration that may be helpful for those Windows System Admins out there. The six main areas that I would like to talk about are: Windows Updates, Restarting the Server, Logging Off, Setting a Static IP Address, Joining a Domain, and Promoting the Server to a Domain Controller.
The first thing that I do whenever I deploy a new server is to make sure that it has the latest updates and patches. To perform this task on Server Core it takes a few extra steps.
- Create WUA_SearchDownloadInstall.vbs on a client computer and save on the C Drive. To create this file you will need to either download it here, or go to Microsoft’s site and copy and paste the script into a text editor and save it as a VBS.
- From your Server Core computer, connect to the client computer’s hard drive:
- NET USE command: net use X: \\CLIENT\C$ /USER:DOMAIN\Username
- PUSHD command: PUSHD \\CLIENT\C$
- Copy the WUA_SearchDownloadInstall.vbsfrom the client to the C drive of the server:
- COPY X:\WUA_SearchDownloadInstall.vbs C:\
- Disconnect from the client computer’s hard drive:
- NET USE command: net use X: /delete
- POPD command: popd
- Run the WUA_SearchDownloadInstall.vbs script via CSCRIPT:
- cscript WUA_SearchDownloadInstall.vbs
- Answer questions at each prompt, and your done!
Restarting the Computer
Restarting a server was easy when there was a GUI, you would click start, go to shutdown, and select the restart option. In Server Core, it’s even easier. To perform a restart, or shutdown, you are going to use the SHUTDOWN command:
Restart Server: shutdown /r /f
Shutdown Server: shutdown /f
These are simple examples of how to shutdown and restart, for a more extensive look at what you can do to shutdown go to the SHUTDOWN command help menu:
- shutdown /?
Just like restarting a server, logging off of Windows Server Core is easier that it was back in the GUI days. To log off simply type the following command:
Setting a Static IP Address
To set a static IP address on a Server Core installation of Windows is a bit trickier than our previous administrative tasks. To set an IP address of a server, we will use the NETSH command. To perform this task follow these steps:
- Determine the Interface Name (IntName) of your NIC:
- netsh interface show interface
- Set the IP Address (IP), Subnet Mask (SM) and Default Gateway (DG):
- netsh interface ipv4 set address name="IntName" source=static address=IP mask=SM gateway=DG
- Configure the DNS Options for the first DNS Server, with the DNS Server’s IP Address (DNSIP):
- netsh interface ipv4 add dnsserver name="IntName" address=DNSIP index=1
- To configure the DNS Options for the other DNS Servers, use the same command but increase the “index=1” to either 2, 3 or 4.
- Run an IPCONFIG to verify that you have the proper settings:
- ipconfig /all
Joining a Domain
In order to add your new Server Core server to your domain, you need to use the NETDOM command. We will first need the following information, the domain which you want to join (<dn>) and the user account that you would wish to use to authenicate the Server Core to the Domain (<un>). Once we have this information, type the following command:
- netdom join %computername% /Domain:<dn> /UserD:<un> /PasswordD:* /REBoot
Promoting the Server to a Domain Controller
I have saved the most fun for last. In previous versions of Windows, it was easy to promote a server to be a Domain Controller; Microsoft provided us with a nice GUI and made it easy. In Server Core it become a bit more tedious. To perform the this, we will use the DCPROMO command, which will be accomplished by following these steps:
- Perform a Forest Prep and a Domain Prep. This will require the Windows Server 2008 installation disk. Located on the disk, under “<Disk Drive>:\Sources\ADPrep\” is a program call ADPrep.exe. From a current domain controller, perform the following steps at the command prompt:
- <Disk Drive>:\sources\ADPrep\adprep.exe /forestprep - <Disk Drive>:\sources\ADPrep\adprep.exe /domainprep
- Once the Active Directory Forest and Domain are prepared, it is time to promote your Server Core. Prior to promoting the server you need to create an unattend text file from a client computer with the following information:
[Unattend] Unattendmode = fullunattend
[DCINSTALL] UserDomain=<domain> SafeModeAdminPassword=<Password> ReplicaOrNewDomain=Replica ReplicationSourceDC=<Current Domain Controller> ReplicaDomainDNSName=<domain> RebootOnCompletion=Yes
Save this file as “unattend.txt” and make sure that it is accessible from your Server Core server.
- Last but not least, we will run DCPROMO from the Server Core server:
- dcpromo /unattend:unattend.txt
Those are my quick administration tips for managing a Windows Server Core server. Hope this article has been helpful.