Server Manager's Power Is In The Command Line

Like most IT Pros deploying and managing Windows Server, I’ve avoided the wizard interfaces, like Manage Your Server, in previous versions of Windows. However with Windows Server 2008, Microsoft have actually succeeded in creating a tool that I think people will find indispensable.

Server Manager is an MMC-based front-end for anything you will need to manage on your servers running Windows 2008. As well as combining many of the individual management tools, it gives you a simple overview of what’s happening on your server and integrates the old Add/Remove Programs interface too.

If you’ve not taken a look at Windows Server 2008 and are interested in reading more about Server Manager, there is a plethora of resources available to you:

The real power of Server Manager and what makes this tool truly worthwhile is it’s command line interface. SERVERMANAGERCMD.EXE replaces what SYSOCMGR.EXE provided in previous versions of Windows, but it does so much more:

A new command-line feature in Server Manager allows unattended installation and removal of Windows Server 2008 technologies. The ServerManagerCmd.exe command-line tool exposes the key set of Server Manager tasks, such as installation or removal of roles, role services and features, validation, and querying the current state of the computer. It also allows for installation or removal of multiple roles, role services, or features in a single command instance by using XML answer files.

Before the implementation of the Server Manager command line, the only command-line tools available for installing Windows software packages on a computer were ocsetup and pkgmgr. The command line syntax for these tools is complex, and the names of roles, role services, and features available for installation or removal by using these two tools were not intuitive. ServerManagerCmd.exe simplifies command-line installation and removal of roles, role services, and features

So, for example, if I am looking to install to install the Network Policy and Access Server, in preparation for configuring Network Access Protection, I would install it via the following command:

SERVERMANAGERCMD -install NPAS -restart

If I am installing Terminal Server components on an existing server, I could run the following command to install the Terminal Server, Licensing and Session Broker components.

SERVERMANAGERCMD -install TS-Terminal-Server,TS-Licensing,TS-Session-Broker -restart

To install the complete Remote Server Administration Tools (RSAT) on a Windows Server 2008 server, run this command (curiously this requires a restart):

SERVERMANAGERCMD -install RSAT -allsubfeatures -restart

Command line interaction with Server Manager also provides the ability to query what roles and features are installed on the server as well as export and import configurations via XML files. This is a great change from earlier versions of Windows and will help to reduce the time spent managing Windows Server 2008.

I’ve included here the complete list of roles and features that you can use with SERVERMANAGERCMD and OCSETUP.EXE in Windows Server 2008 and Windows Server Core. Don’t reach for that GUI, real men and women use the command line.

Here’s something I really like: using SERVERMANAGERCMD -QUERY via Windows PowerShell makes seeing what’s installed on your server nice and simple (Update: this works under Command Prompt too):

Query

For more information on Server Manager with PowerShell , read Marc van Orsouw’s post: Dueling Command Lines in Windows Server 2008 ? .. or a happy end ?.

What About Server Core?

Server Manager is not included in a Server Core installation. Subsequently the command line version is not installed either. Management of features and roles in Server Core is performed via OCSETUP and OCLIST. OCSETUP is the same tool included in Windows Vista for managing features and works the same way on Server Core.

Unfortunately we don’t get the ability to save OCLIST’s output to XML for import to another server, but OCSETUP does provide an answer file option for automating the installation or removal of features.

More Reading