Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

January 16, 2008 12:00 AM

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

Windows IT Pro
InstantDoc ID #98051
Rating: (1)
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
[ ] 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.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.