Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


January 16, 2008

Q. How do I use the command line to install Windows Server 2008 Roles and Features?

RSS
Subscribe to Windows IT Pro | See More Installation Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

A. The Server Manager GUI is great, but it's not so wonderful for Server Core installations and some automated functions. Fortunately, Server Manager has a command-line version—servermanagercmd.exe. You can execute this command with its –query switch to list all known Roles and Features, as you see below. Installed Roles and Features are checked in the output and displayed in green.

servermanagercmd.exe -query
..

----- Roles -----

[ ] Active Directory Certificate Services [AD-Certificate]
[ ] Certification Authority [ADCS-Cert-Authority]
[ ] Certification Authority Web Enrollment [ADCS-Web-Enrollment]
[ ] Online Responder [ADCS-Online-Cert]
[ ] Network Device Enrollment Service [ADCS-Device-Enrollment]
[X] Active Directory Domain Services
[X] Active Directory Domain Controller [ADDS-Domain-Controller]
[ ] Identity Management for UNIX [ADDS-Identity-Mgmt]
..
..
----- Features -----

[ ] .NET Framework 3.0 Features [NET-Framework]
[ ] .NET Framework 3.0 [NET-Framework-Core]
[ ] XPS Viewer [NET-XPS-Viewer]
[ ] WCF Activation [NET-Win-CFAC]
[ ] HTTP Activation [NET-HTTP-Activation]
[ ] Non-HTTP Activation [NET-Non-HTTP-Activ]
[ ] BitLocker Drive Encryption [BitLocker]
[ ] BITS Server Extensions [BITS]
[ ] Connection Manager Administration Kit [CMAK]
[X] Desktop Experience [Desktop-Experience]
[ ] Failover Clustering [Failover-Clustering]
[X] Group Policy Management [GPMC]
[ ] Internet Printing Client [Internet-Print-Client]
..
..

If you add a filename to the end of the query, the output will generate an XML file giving you the same information and the Role or Feature ID, which is required to add or remove Roles and Features from the command line. In the example below, the file has an entry for a Telnet client, and shows the friendly name and the ID.

In this case, the ID is "Telnet-Client." To install the client from the command line, I would use the command:

servermanagercmd -install telnet-client -whatif
..
Note: Running in 'WhatIf' Mode.
Specified for installation: [Telnet Client]

This server may need to be restarted after the installation completes.

Here, I didn't actually install anything. As with PowerShell, I can use the -whatif switch to show me what will happen if I run the command. To install the Telnet Client, just remove the -whatif switch. To uninstall a Role or Feature, use -remove instead of -install. If a server is to have many Roles and you want to install all the Role Services, use the -allsubfeatures switch to install everything for the named Role or Feature.

End of Article



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Windows 7 Sets Sales Record

Microsoft CEO Steve Ballmer described Windows 7's first ten days of sales as "fantastic" while in Japan yesterday. ...


Related Events WinConnections and Microsoft® Exchange Connections

Deep Dive into Windows Server 2008 R2 presented by John Savill

Managing IT Across Multiple Locations

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement