Windows 7 / Getting Started

Server Manager Command-Line Tool

The ServerManagerCmd.exe is a command-line tool that installs and removes roles, role services, and features. The command also displays the list of all roles, role services, and features available, and shows which are installed on this computer. This is a useful tool for automating the Server Manager tasks, such as creating a batch file that will install a set of roles and features on a server.

For example, if an administrator wants to check what roles and features are installed on a server, the command is as follows:

ServerManagerCmd.exe -query

This command shows a text list of all roles and features, with the installed ones marked with an X and also helpfully highlighted in green.

The full syntax for the command is as follows:

ServerManagerCMD.exe
-query [<query.xml>] [-logPath <log.txt>]

-install <name>
[-setting <setting name>=<setting value>]* [-allSubFeatures]

[-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]

-remove <name>
[-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]

-inputPath <answer.xml>
[-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]

-help | -?

-version

Switch Parameters:

-query [<query.xml>]
Display a list of all roles, role services, and features available,
and shows which are installed on this computer. (Short form: -q)
If <query.xml> is specified, the information is also saved to a
query.xml file with additional information such as available settings.

-inputPath <answer.xml>
Installs or removes the roles, role services, and features specified
in an XML answer file, the path and name of which is represent by
<answer.xml>. (ShortForm: -ip)

-install <name>
Installs the role, role service, or feature on the computer that
is specified by the <name> parameter. Multiple roles, role services or
features must be separated by spaces. (ShortForm: -i)

-setting <setting name>=<setting value>
Used with the -install parameter to specify required settings for the
installation. (Short form: -s)

-allSubFeatures
Used with the -install parameter to install all subordinate
role services and features along with the role, role service, or
feature named with the -install parameter. (Short form: -a)

-remove <name>
Removes the role, role service, or feature from the computer that
is specified by the <name> parameter. Multiple roles, role services or
features must be separated by spaces. (ShortForm: -r)

-resultPath <result.xml>
Saves the result of the ServerManagerCmd.exe operation to a <result.xml>
file, in XML format. (Short form: -rp)

-restart
Restarts the computer automatically, if restarting is necessary to
complete the operation.

-whatIf
Display the operations to be performed on the current computer
that are specified in the answer.xml file. (Short form: -w)

-logPath <log.txt>
Specify the non-default location for the log file. (Short form: -l)

-help
Display help information. (Short form: -?)

-version
Display the version of the Server Manager command that is running,
Microsoft trademark information, and the operating system.
(Short form: -v)

The Server Manager command line can also be used against remote servers with the Windows Remote Management shell (WinRM). For example, to execute a query against a remote target server dc3.companyabc.com, the command would be as follows:

Winrs -remote:http://dc3.companyabc.com ServerManagerCmd.exe -query

This command shows the roles and features installed on the remote target server, albeit without the cool green highlights.

Print Management Console

The Print Management console allows administrators to manage printers across the enterprise from a single console. It shows the status of printers on the network. It also allows the control of those printers, such as:

  • Pausing or resuming printing
  • Canceling jobs
  • Listing printers in Active Directory
  • Deleting printers
  • Managing printer drivers

Many of the operational controls support multiselecting printers, so that the commands can be run against many printers at once.

The Print Management console is available within the Server Manager console or as a stand-alone tool. Server Manager is the preferred method of accessing the Print Management console, as it will also manage the role and provide event messages and other operational information.

The Print Management console supports printers running on a wide variety of operating systems, including Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and even Windows 2000.

[Previous] [Contents] [Next]