Using the new Windows Server 2008 Core OCList and OCSetup CLI tools to Add & Remove Server Roles
In our last article, Using the new Windows Server 2008 ServerManagerCmd.exe CLI tool to Add & Remove Server Roles, we covered a new Windows Server 2008 command line tool, ServerManagerCMD.exe. That tool is only available in the standard GUI installation of Windows Server 2008, not in the Windows Server 2008 CORE Installation. This is because Server CORE does not have the .NET Framework and ServerManagerCMD requires the .NET Framework.
As Windows Server 2008 CORE does not have any graphical interface, you must use only command line tools so without ServerManagerCMD, the tools to use in Windows Server 2008 CORE to view, add, and remove roles are OCLIST and OCSETUP.
What are Roles?
Before I demonstrate how to use OCLIST and OCSETUP to administer server Roles, let’s first take a step back and answer what are Server Roles? I want to do this because the concept of Server Roles is new in Windows Server 2008.
Examples of Roles for your server are:
- File Services
- Telnet Client
- Print Services
- (and more)
It is easy to add these roles in the Windows Server 2008 GUI, as in Figure 1, below.
Figure 1: Adding Roles with the Windows Server 2008 GUI
However, how are you going to view, add, and remove these roles when you are at the Windows Server 2008 CORE command prompt (with no GUI interface available)? How would you do it? Let’s find out...
What are OCLIST.exe & OCSETUP.exe?
Just as the concept of “Roles” is new in Windows Server 2008, you are offered a couple of new CLI tools to manage those Roles in Windows Server 2008 CORE.
Those tools are OCLIST.exe & OCSETUP.exe
With OCLIST, you can query the installed roles on your Windows Server 2008 CORE server by simply typing OCLIST at the command prompt, like this:
Figure 2: Showing installed Roles with OCLIST.exe
In Figure 2, the oclist command was run right after the Windows Server 2008 CORE server was installed. As you can see, there are a number of roles available but not installed. To install these roles, we use OCSETUP.
With OCSETUP.exe, you can do the following:
- Install & uninstall new Server 2008 CORE Roles
- Perform logging on the install of those roles
- Perform quiet or unattended installations
- Supply parameters to the installation routine
- And choose not to restart the server after an installation, even if it is required for the install to be complete
If you run OCSETUP.exe without any parameters, you will see a help screen, like this:
Figure 3: OCSETUP Help Screen shown when run with no parameters
How do I install a Windows Server 2008 CORE Role with OCSETUP?
To install a Windows Server 2008 CORE Role with OCSETUP, let’s look at an example. Let’s say that we wanted to install the Windows Server DHCP Role / Component. As we saw from the OCLIST output, above, the Windows Server DHCP role was not installed by default.
To install DHCP on our CORE server with OCSETUP, we do the following:
start /w ocsetup DHCPServerCore
Let’s examine this command line string, step by step:
- Optionally, we use the start command because it will open up a new CMD prompt window that we can use to monitor the progress of the install. Plus it frees our current CMD prompt window so that we can continue to do other things while the installation is happening
- If we used the start command, we also use the /w (or /WAIT) switch with the start command so that the command prompt will wait for the command that is executed to terminate before closing the window. This way, we can see what happens with the installation.
- Of course, we use the OCSETUP command
- With the OCSETUP command, we specify what component we want to install. Each of the components has its own, specific, name. You can view the available component names in the output of the OCLIST command. In our case, we specified the name of the DHCP component, DHCPServerCore.
When you run this command, you won’t see ANY output, at all (unless you mistyped it). So, here is what a successful install looks like:
Figure 4: Results of DHCP Server Core Install with OCSETUP
That’s right, no real output. So how do you know if it was successfully installed? Easy, run OCLIST, like this:
Figure 5: Verifying a successful install using OCLIST
As you can see, the DHCPServerCore was successfully installed.
However, is the DHCP server fully functional at this point? No.
To get our DHCP server fully functioning, we need to configure a scope using the netsh command or using the MMC DHCP snap-in from a remote system.
Next, we need to set the DHCP service to start automatically using sc config dhcpserver start=auto then start the service manually for the first time with net start dhcpserver.
What other common Windows Server 2008 CORE Roles can I install?
Some other common Core server roles are:
- DNS Server – DNS-Server-Core-Role
- File Server – FRS-Infrastructure
- Print Server – Printing-ServerCore-Role
For example, here is an install of the DNS Server Core Role:
Figure 6: Installation of the Windows Server 2008 Core DNS Server Role
You would then need to configure the DNS Server zones using the dnscmd CLI utility or remotely using the DNS MMC Snap-in.
Say that you did want to Uninstall the DNS Server role, you would run the same command with the /uninstall switch, like this:
Figure 7: Uninstall of the Windows Server 2008 Core DNS Server Role
As with this uninstall, some installs or uninstalls that are done will require you to reboot your Windows Server 2008 Core server. When that happens, you will see a pop-up message, like this:
Figure 8: Message that the Core server must be restarted before the changes take effect
What else do I need to know?
One important thing to note is this - if you want to make a Windows Server 2008 CORE system a Windows Active Directory domain controller (DC), then you should NOT use OCSETUP. Instead, you should use DCPromo to install or uninstall Windows Active Directory.
If you are using or plan on using Windows Server 2008 CORE, the OCLIST and OCSETUP command line utilities are necessary for any administrator to understand. With OCLIST, you can query the Windows Server 2008 CORE roles and components that are installed. With OCSETUP, you can add & remove the same Core Server Roles. When using Windows Server 2008 CORE, you must use these commands for Role administration as there aren’t any GUI tools available on the server. Additionally, the ServerManagerCMD CLI utility, available in normal (non-core) versions of Windows Server 2008, is not available in Windows CORE. Once these Roles are installed, they will still need to be started and configured using either local command line utilities or remote Windows MMC administrative tools.