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
Command Prompt Tricks

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

WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...

The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...


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

Related Events 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 © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing