servermanagercmd
Installs and removes roles, role services, and features. Also displays the list of all roles, role services, and features available, and shows which are installed on this computer.
Important
This command, servermanagercmd, has been deprecated and it's not guaranteed to be supported in future releases of Windows. We recommend instead that you use the Windows PowerShell cmdlets that are available for Server Manager. For more information, see Install or Uninstall Roles, Role Services, or Features.
Syntax
servermanagercmd -query [[[<drive>:]<path>]<query.xml>] [-logpath [[<drive>:]<path>]<log.txt>]
servermanagercmd -inputpath [[[<drive>:]<path>]<answer.xml>] [-resultpath <result.xml> [-restart] | -whatif] [-logpath [[<drive>:]<path>]<log.txt>]
servermanagercmd -install <id> [-allSubFeatures] [-resultpath [[<drive>:]<path>]<result.xml> [-restart] | -whatif] [-logpath [[<Drive>:]<path>]<log.txt>]
servermanagercmd -remove <id> [-resultpath <result.xml> [-restart] | -whatif] [-logpath [[<drive>:]<path>]<log.txt>]
servermanagercmd [-help | -?]
servermanagercmd -version
Parameters
Parameter | Description |
---|---|
-query [[[<drive>:]<path>]<query.xml>] |
Displays a list of all roles, role services, and features installed and available for installation on the server. You can also use the short form of this parameter, -q. If you want the query results saved to an XML file, specify an XML file to replace <query.xml> . |
-inputpath [[[<drive>:]<path>]<answer.xml>] |
Installs or removes the roles, role services, and features specified in an XML answer file represented by <answer.xml> . You can also use the short form of this parameter, -p. |
-install <id> |
Installs the role, role service, or feature specified by <id> . The identifiers are case-insensitive. Multiple roles, role services, and features must be separated by spaces. The following optional parameters are used with the -install parameter:
|
-remove <id> |
Removes the role, role service, or feature specified by <id> . The identifiers are case-insensitive. Multiple roles, role services, and features must be separated by spaces. The following optional parameters are used with the -remove parameter:
|
-version | Displays the Server Manager version number. You can also use the short form, -v. |
-help | Displays help in the Command prompt window. You can also use the short form, -?. |
Examples
To display a list of all roles, role services, and features available, and which roles, role services, and features are installed on the computer, type:
servermanagercmd -query
To install the Web Server (IIS) role, and save the installation results to an XML file represented by installResult.xml, type:
servermanagercmd -install Web-Server -resultpath installResult.xml
To display detailed information about the roles, role services, and features that would be installed or removed, based upon instructions that are specified in an XML answer file represented by install.xml, type:
servermanagercmd -inputpath install.xml -whatif