Managing Windows features from the command line with RSAT

Note: An update of this article for Windows 10 can be found here

One of the more useful Windows features for Windows administrators is the Remote Server Administration Tools pack (RSAT).

Apart from allowing you to install GUI elements in the Administrative Tools menu, this can also install the command-line tools for querying and managing Active Directory: dsquery.exe, dsadd.exe, dsget.exe, dsmod.exe, dsmove.exe and dsrm.exe.

Note from Microsoft:
**Remote Server Administration Tools for Windows 7 with SP1 can be installed ONLY on computers that are running the Enterprise, Professional, or Ultimate editions of Windows 7 or Windows 7 with SP1.**

The version for Windows 7 can be used to manage Windows 2003, 2008 and W2008 R2, and can be obtained here.

For completeness: The version for Windows 8 can be used to manage Windows 2012, and can be obtained here. I have not tested that version, however, as I don’t use Windows 8.

To manage features using the command line, use the dism command.
This command can also be used to enable features on Windows 2008 and 2012 servers.

The dism command also works if your no-brain domain administrator has used a policy to disable the Features management (“Turn Windows features on or off“) in the Programs and Features control panel. Of course, you do need to be a local administrator.

By the way, that policy is stored in the registry at

This is the reg command to disable the policy:

To list all the features available on a PC, and their state (disabled/enabled), use:

For instance, to install the Telnet Client, use:

Or, if you need to print to an LPR printer on your network, you need to install the LPR print port monitor:

Be aware that the feature names are case-sensitive. The /featurename parameter can be repeated multiple times, and some features have dependencies which need to be specified before them on the command line. The dism command will report failures because of dependencies, so you can build a correct command line by experimenting.

To install the Active Directory components from the RSAT tools pack, you need first to download and install the pack (duh).
Then, the following command installs the AD tools, including the ds* command line tools:

Available Windows 7 Enterprise features (sorted by name):

Available Remote Server Administration Tools features: