Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  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 log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
IE Usage Share Fell in 2008

According to researchers at Net Applications, use of Microsoft's Web browser, Internet Explorer, fell from 74 percent to 68 percent of the market by the end 2008. The main beneficiary of that decline was Mozilla Firefox, which jumped to 21 percent usage ...

The Day the Music Died: First-Gen Zune Devices Failed for One Day Last Week

For the few people in North America who bought a first generation Zune 30 portable media player, December 31, 2008 will be a day that lives in infamy. On that day, all Zune 30 devices fell silent after succumbing to a weird date-related bug. The fix was ...

Understanding File-Size Limits on NTFS and FAT

A general confusion about files sizes on FAT seems to stem from FAT32's file-size limit of 4GB and partition-size limit of 2TB. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing