Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
Pluralsight + Digital-Tutors - 3,000 tech & creative courses - starting at $29/month Get it now →
April 9, 2008

Role Playing with Windows 2008 Server Core

By

Ok, you’ve installed Windows Server 2008 Core, and it is pretty awesome.

Those lower-level administrators that run to Ted whenever things get tough have stood before the daunting black command-line box and trembled in fear at the blinking white cursor. You sneered as you waited to see if they would break down and cry at the prospect of being without their precious mouse.

But, you’re getting tired of just showing off your GUI-less install. It’s time to take this server out for a spin and see what it can do.

If you aren’t sure what role you want to assign yet, you can just play around with it, "role playing," if you will. Hah! Ok, it isn’t that funny, but a no-GUI sever isn’t that great until it can do something either.

It needs to have a role installed.

Installing a role in a Server 2008 full install is so easy a 1st Level Magic-User Dwarf could do it (more role playing, heh).

Just open up Server Manager and a few clicks later you’ve got a role installed or uninstalled.

Obviously, on a server without a GUI, Server Manager is out … or is it?

Available Roles

On a Windows Server 2008 Core install, just eight roles are available. All other roles take too many dependent processes or are too complicated themselves to reside on a core install. The available roles are:

  • Active Directory
  • Active Directory LDS
  • DHCP Server
  • DNS Server
  • File Services
  • Print Services
  • Streaming Media Services
  • Windows Server Virtualization

Server Manager Command-Line Style

The beta testing phase for Server 2008 was much longer than usual. As a result, the engineers at Microsoft got some extra time to code in features. One of those features was a command line interface for Server Manager.

That command is servermanagercmd.exe and it is great for scripting all sorts of commands and even for installing and removing roles.

Since you are a hard-core administrator, you already know all about servermanagercmd and you don’t need no stinkin’ GUI. So, you start typing …

Role Playing with Windows 2008 Server Core - 1

"What the–?" Although servermanagercmd is a command-line utility, it is still part of the very extensive Server Manager program. Unfortunately, Server Manager has too many dependencies on APIs and processes that are not installed on Server Core, so servermanagercmd is out.

Instead, Microsoft has supplied another lower-level command that does not have the dependencies of Server Manger. The command, ocsetup.exe, and its partner in crime, oclist.exe provide the functionality to install server roles.

Neither of these commands exists on a full install of Windows Server 2008, so you’ll have to stick with servermanagercmd for command-line execution on a full install.

Oclist.exe and Ocsetup.exe

Grab your trusty TechNet CD and punch in your query. Installing a role on a Server Core install takes a command called ocsetup.exe. Check out the syntax:

c:\Windows\System32\>start /w ocsetup DNS-Server-Core-Role

The /w switch makes sure that control doesn’t come back to the command prompt until ocsetup has finished executing. This is a good thing because it can take a few minutes to complete installing the role and this way things won’t get messed up by moving on to the next step before the install is complete.

I know what you are thinking, "Yea, though I walk through the Valley of the Shadow of No-GUI, I shall fear no administration task, for I am the meanest administrator in the Valley." You figure you’ll memorize "DNS-Server-Core-Role" so that you never again need to go back into your TechNet to install a role. Ted would want it that way.

Think again, Super-Admin. For some inexplicable reason the ocsetup command is CaSe SensaTive! Not only that, but there is no logic to the naming of the roles. You’re thinking that if DNS Server is DNS-Server-Core-Role then DHCP Server must be DHCP-Server-Core-Role, right? Bzzzz! Wrongo! Hey, where did Ted get that buzzer from anyway?

Installing the DHCP Server role actually takes the parameter DHCPServerCore – no hyphens, no "Role." With eight different roles available on Server Core, you could memorize them all, but then again, there is Super-Admin and then there is Computer Nerd With No Life. You don’t want to go there.

Instead, we turn to the oclist.exe command. Oclist covers much of the role played by servermanagercmd -query over in the full installation world. Type oclist.exe and after a brief delay all the roles and features available are listed along with whether or not they are installed. The way they are displayed, is the way they have to be typed in. No need to memorize.

Role Playing with Windows 2008 Server Core - 2

The Active Directory Role

With ocsetup and oclist you can install all of the roles available on Server Core except for the Active Directory role. The Active Directory role requires more than just copying new files and starting a service. The server must also be promoted.

So, the command necessary for installing the Active Directory role is dcpromo.exe. But, there is a catch (of course there is). Typing dcpromo launches the GUI for promoting and demoting servers. This is Server Core, so there is no GUI.

The trick is to run dcpromo in unattended mode. That way it doesn’t bother trying to launch the GUI. The unattended mode is triggered by the /unattend switch and takes an input parameter of a text file. That text file must contain the input normally provided by clicking around the GUI. So, assuming our input text file is named inputfile.txt then the syntax is:

dcpromo /unattend:inputfile.txt

The format of the text file is fairly simple. It starts with "[DCInstall]" and then each parameter with an equals sign, followed by the value you with to set. So, something like this:

[DCInstall]
UserName=Ted
Password=*
SiteName=TheSite
NewDomain=DomainName
NewDomainDNSName=ourcompany.com

… and so on. Depending on the structure of your enterprise, your inputfile.txt file can be very long (or very short).

Microsoft provides a full list of parameters, their function, and use with the "Appendix of Unattended Installation Parameters" under "Windows Server 2008 Technical Library > Active Directory Domain Services > Getting Started: AD DS > Step-by-Step Guide for Windows Server 2008 Active Directory Domain Services Installation and Removal" either online or on TechNet. (You may have to use the Table of Contents Panel to navigate there online.)

Role Playing with Windows 2008 Server Core - 3

With a server role installed, your Windows Server Core install is ready for the big-time, just like your 11th Level Paladin. Now if we can just find out where Ted keeps that buzzer…

About the Author

(MCSE, CNA) is a professional freelance writer and small business owner with the freelance writing business ArcticLlama, LLC. Brian’s experience includes network and systems administration, financial planning and advising, and he even has a degree in Biochemistry. Brian specializes in several areas of highly technical writing for ArcticLlama including technology, science and medical. He is also a freelance financial writer specialist. He lives in Colorado with his wife and daughter. Brian contributes articles on Windows Server 2008 and other related topics.

Author's Website: http://www.arcticllama.com/


Discussion