Overview of Server Manager Commands
Server Manager in Windows Server® 2008 offers a command-line tool, ServerManagerCmd.exe, to enable users to perform automated installations or removals of roles, role services, and features. ServerManagerCmd.exe options enable users to view logs of its operations and to run queries to display lists of roles, role services, and features that are both installed and available for installation on a computer.
ServerManagerCmd.exe can be used with an XML answer file to expedite repetitive automated installations or removals of roles or features. For more information about the answer file that you can use with ServerManagerCmd.exe, see Creating an Answer File for Server Manager Commands.
The ServerManagerCmd.exe command
The Server Manager command-line installation accepts parameters to install or to remove one role, role service, and feature per command instance. When you want to install or to remove more than one role, role service, or feature on a server by using a single command instance, use an XML answer file. For more information about the answer file that you can use with ServerManagerCmd.exe, see Creating an Answer File for Server Manager Commands.
Note
ServerManagerCmd.exe can be executed from within any directory on the server's local drives. You must be a member of the Administrators group on the server on which you intend to install or to remove software.
Important
Because of security restrictions imposed by User Account Control, you must run ServerManagerCmd.exe in a Command Prompt window opened with elevated privileges. To do this, right-click the Command Prompt executable file, or the Command Prompt object on the Start menu, and then click Run as administrator.
Syntax
ServerManagerCmd.exe -query [<query.xml>] [-logPath <log.txt>]
ServerManagerCmd.exe -inputPath <answer.xml> [-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]
ServerManagerCmd.exe -install <command-Id> [-setting <setting-name>=<setting value>][-allSubFeatures] [-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]
ServerManagerCmd.exe -remove <command-Id> [-resultPath <result.xml> [-restart] | -whatIf] [-logPath <log.txt>]
ServerManagerCmd.exe [-help | -?]
ServerManagerCmd.exe -version
Parameters
Parameter | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-query [<query.xml>] [-logPath <log.txt>] |
Displays a list of all roles, role services, or features installed and available for installation on the server. You can also use the short form of this parameter, -q.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-logPath <log.txt> |
Specifies a name and a location for the log file, other than the default, %WINDIR%\temp\servermanager.log. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-inputPath <answer.xml> |
Installs or removes the roles, role services, or features specified in the answer file, an XML file represented by answer.xml. You can also use the short form of this parameter, -p, instead of -inputPath.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-resultPath<result.xml> |
Saves installation results to an XML file represented by result.xml. You can also use the short form of this parameter, -r. You cannot use the -resultPath and the -whatIf in the same instance of ServerManagerCmd.exe. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-restart |
Added to the -install option, restarts the computer automatically when installation is complete, if restarting is required by the roles or the features installed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-whatIf |
Displays any operations specified for the -install option. You can also use the short form of the -whatIf parameter, -w. You cannot use the -resultPath parameter and the -whatIf parameter in the same instance of ServerManagerCmd.exe. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-logPath<log.txt> |
Specifies a name and a location for the log file, other than the default, %WINDIR%\temp\servermanager.log. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-install <Id> |
Installs the role, role service, or feature specified by Id. See "Role, role service, and feature command identifiers" in this topic for a complete list of the role, role service, or feature identifiers from which you can choose to specify for Id. The identifiers are not case-sensitive.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-setting <setting name>=<setting value> |
Specifies required settings for the installation. See "Role, role service, and feature command identifiers" in this topic for a complete list of available settings. This parameter can be specified multiple times so that multiple roles, role services, and features can be installed simultaneously. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-allSubFeatures |
Specifies the installation of all subordinate services and features along with the parent role, role service, or feature named in the -install command's Id parameter. Note Note that some role containers do not have a command line identifier to enable the installation of all role services. This is the case when role services cannot be installed in the same instance of the Server Manager command. For example, the Federation Service role service of Active Directory Federation Services and the Federation Service Proxy role service cannot be installed by using the same Server Manager command instance. -resultPath<result.xml
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-remove <Id> |
Removes the role, role service, or feature specified by Id. See "Role, role service, and feature command identifiers" in this topic for a complete list of the role, role service, and feature identifiers from which you can choose to specify for Id. The identifiers are not case-sensitive.
The tables in this section match roles, role services, or features available in Windows Server 2008 with the command identifiers you must use with ServerManagerCmd.exe to install or to remove them. DHCP Server DHCP The DHCP Server role should be installed with default settings. Print Services Print-Server During removal of this role in the Server Manager user interface (UI), you are prompted to delete instances of printers configured on the server. By default, these instances are preserved, which is the default behavior of command-line removal of the Print Services role. Terminal Services Terminal-Services Because Terminal Services settings can be configured after installing the role, you are not required to specify Terminal Services settings in the command-line answer file. Active Directory Domain Services (No command) After installing Active Directory Domain Services (AD DS), you must run the dcpromo command to promote the server to a domain controller. Removing the AD DS role while the computer is operating as a domain controller fails. You must first demote the domain controller to a standard domain member. DNS Server DNS None File Services (No command) You cannot install or remove the File Services container by using the Server Manager command line. You can install or remove the File Services container only by using the Server Manager UI. Note that, for this reason, there is no command ID available to represent the File Services container. Because you can configure File Services settings after installing the role, you are not required to specify File Services settings in the Server Manager command-line answer file. Note that Services for Network File system is not part of the File Services role on computers running Windows Server® 2008 for Itanium-Based Systems. Web Server (IIS) Web-Server None Active Directory Federation Services (No command) Active Directory Federation Services should be installed with default settings. Active Directory Lightweight Directory Services ADLDS None Application Server Application-Server If you install the WS-Atomic Transaction Support role service, you should also configure it to use a self-signed certificate. Active Directory Certificate Services (No command) Certification Authority and Online Certificate Status Protocol can be installed by using the Server Manager command-line interface. Other role services for Active Directory Certificate Services cannot be installed by using the Server Manager command line. Fax Server Fax Fax Server should be installed with default settings. Network Policy and Access Services NPAS Because Network Policy and Access Services settings can be configured after installing the role, you are not required to specify Network Policy and Access Services settings in the command-line answer file. Active Directory Rights Management Services (AD RMS) Active Directory Rights Management Services (AD RMS) cannot be installed by using the Server Manager command line. None UDDI Services UDDI Services is not installable by using the Server Manager command line. You cannot install UDDI Services by using the Server Manager command-line because complex database settings are required during UDDI Services setup. Windows Deployment Services WDS None Failover Clustering Failover-Clustering Network Load Balancing NLB Desktop Experience Desktop-Experience .NET Framework 3.0 Features NET-Framework Note that the command-line syntax for .NET Framework 3.0 Features does not contain the "." character before NET. Windows System Resource Manager WSRM Wireless Networking Wireless-Networking Windows Server Backup Backup WINS Server WINS-Server Remote Assistance Remote-Assistance Simple TCP/IP Services Simple-TCPIP Telnet Client Telnet-Client Telnet Server Telnet-Server Subsystem for UNIX-based Applications Subsystem-UNIX-Apps RPC over HTTP Proxy RPC-over-HTTP-Proxy SMTP Server SMTP-Server LPR Port Monitor LPR-Port-Monitor Storage Manager for SANs Storage-Mgr-SANS BITS Server Extensions BITS Message Queuing MSMQ Windows Process Activation Service WAS Windows Internal Database Windows-Internal-DB BitLocker Drive Encryption BitLocker Multipath I/O Multipath-IO Internet Storage Naming Server ISNS Removable Storage Removable-Storage TFTP Client TFTP-Client SNMP Services SNMP-Services Services for Network File System NFS-Services Services for Network File System is only available as a feature on computers running Windows Server® 2008 for Itanium-Based Systems. Internet Printing Client Internet-Print-Client Peer Name Resolution Protocol PNRP Connection Manager Administration Kit CMAK Remote Server Administration Tools RSAT Windows PowerShell PowerShell Group Policy Management GPMC Quality Windows Audio Video Experience Qwave ServerManagerCmd.exe does not support configuration or management of roles and features, after those are installed. Role and feature installations completed by using ServerManagerCmd.exe use default settings. To modify role or feature settings, to perform role administration tasks, or to view status or events for roles and features, you should use the Windows GUI–based Server Manager console. You might need to open other management snap-ins for your role that cannot be opened from within the Server Manager window. Note Although role and feature installations are secure by default, you should use the Server Manager console to modify any default settings to conform to security policies in your enterprise. ServerManagerCmd.exe cannot be used to install and to configure applications other than Windows Server 2008 roles, role services, or features. ServerManagerCmd.exe is not supported on computers running a Server Core installation option of Windows Server 2008. ServerManagerCmd.exe cannot be used for installation or removal of roles, role services, or features on remote computers. The following are examples of how Server Manager commands are used. The following shows the ServerManagerCmd.exe syntax for installing Web Server (IIS) and all its role services. The administrator exports the results of the installation to an XML file called WebServer.xml. The administrator has also instructed Server Manager to restart the computer automatically when installation is complete, if required by the role. An administrator is using the following command to repurpose several servers by removing a number of features. Commands for the features to be removed are provided in an answer file named RemoveAllTelnet.xml. The administrator has added the -whatIf option to the command to display the command operations specified in the Removalresults.xml answer file, and show if any software that is dependent on the items specified for removal in the answer file was also removed. Windows Script Center (https://go.microsoft.com/fwlink/?LinkID=63080) Interpreting Output from Server Manager Commands |