Servermanagercmd
Applies To: Windows Server 2008, Windows Server 2008 R2
Important
This command is available only on servers that are running Windows Server 2008 or Windows Server 2008 R2. Servermanagercmd.exe has been deprecated, and is not available in Windows Server 2012. For information about how to install or remove roles, role services, and features in Windows Server 2012, see Install or uninstall roles, role services, and features on Microsoft TechNet.
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. For additional information about the roles, role services, and features that you can specify by using this tool, see the Server Manager Help. (https://go.microsoft.com/fwlink/?LinkID=137387).
For examples of how to use this command, see Examples.
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.
|
||
-help |
Displays Help in the Command Prompt window. You can also use the short form, -?. |
||
-version |
Displays the Server Manager version number. You can also use the short form, -v. |
Remarks
Servermanagercmd is deprecated, and is not guaranteed to be supported in future releases of Windows. We recommend that if you are running Server Manager on computers that are running Windows Server 2008 R2, you use the Windows PowerShell cmdlets that are available for Server Manager. For more information, see Server Manager cmdlets.
Servermanagercmd can be run from any directory on the server's local drives. You must be a member of the Administrators group on the server on which you want to install or remove software.
Important
Because of security restrictions imposed by User Account Control in Windows Server 2008 R2, you must run Servermanagercmd in a Command Prompt window opened with elevated permissions. To do this, right-click the Command Prompt executable, or the Command Prompt object on the Start menu, and then click Run as administrator.
Examples
The following example shows how to use servermanagercmd to display a list of all roles, role services, and features available, and which roles, role services, and features are installed on the computer.
servermanagercmd -query
The following example shows how to use servermanagercmd to install the Web Server (IIS) role, and save the installation results to an XML file represented by installResult.xml.
servermanagercmd -install Web-Server -resultPath installResult.xml
The following example shows how to use the –whatIf parameter with servermanagercmd 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.
servermanagercmd -inputPath install.xml -whatIf
Additional references
For a complete list of the role, role service, or feature identifiers you can specify for the Id parameter, or more information about using an XML answer file with Servermanagercmd, see the Server Manager Help. (https://go.microsoft.com/fwlink/?LinkID=137387).
See Server Manager cmdlets for a listing of Windows PowerShell cmdlets that are available for Server Manager.