Exportovat (0) Tisk
Rozbalit vše

Servermanagercmd

Aktualizováno: duben 2012

Rozsah platnosti: Windows Server 2008, Windows Server 2008 R2

Installs and removes Role, služby rolí a funkce. Also displays the list of all Role, služby rolí a funkce available, and shows which are installed on this computer. For additional information about the Role, služby rolí a funkce that you can specify by using this tool, see the Server Manager Help. (http://go.microsoft.com/fwlink/?LinkID=137387).

For examples of how to use this command, see Examples.

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

 

Parameter Description

-query [[[<Drive>:]<Path>]<query.xml>]

Displays a list of all Role, služby rolí a funkce 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 Role, služby rolí a funkce 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, služba role a funkce specified by Id. The identifiers are case-insensitive. Multiple Role, služby rolí a funkce must be separated by spaces. The following optional parameters are used with the -install parameter.

  • -setting <SettingName>=<SettingValue>   Specifies required settings for the installation.

  • -allSubFeatures   Specifies the installation of all subordinate services and features along with the parent Role, služba role a funkce named in the Id value.

    notePoznámka
    Some role containers do not have a command line identifier to allow installation of all role services. This is the case when role services cannot be installed in the same instance of the Správce serveru 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 Správce serveru command instance.

  • -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.

    notePoznámka
    You cannot run servermanagercmd with both the -resultPath parameter and the -whatIf parameter specified.

  • -restart   Restarts the computer automatically when installation is complete (if restarting is required by the roles or features installed).

  • -whatIf   Displays any operations specified for the -install parameter. You can also use the short form of the -whatIf parameter, -w. You cannot run servermanagercmd with both the -resultPath parameter and the -whatIf parameter specified.

  • -logPath <[[<Drive>:]<Path>]log.txt>   Specifies a name and location for the log file, other than the default, %windir%\temp\servermanager.log.

-remove <Id>

Removes the Role, služba role a funkce specified by Id. The identifiers are case-insensitive. Multiple Role, služby rolí a funkce must be separated by spaces. The following optional parameters are used with the -remove parameter.

  • -resultPath <[[<Drive>:]<Path>]result.xml>   Saves removal results to an XML file represented by result.xml. You can also use the short form of this parameter, -r.

    notePoznámka
    You cannot run servermanagercmd with both the -resultPath parameter and the -whatIf parameter specified.

  • -restart   Restarts the computer automatically when removal is complete (if restarting is required by remaining roles or features).

  • -whatIf   Displays any operations specified for the -remove parameter. You can also use the short form of the -whatIf parameter, -w. You cannot run servermanagercmd with both the -resultPath parameter and the -whatIf parameter specified.

  • -logPath <[[<Drive>:]<Path>]log.txt>   Specifies a name and location for the log file, other than the default, %windir%\temp\servermanager.log.

-help

Displays Help in the Command Prompt window. You can also use the short form, -?.

-version

Displays the Správce serveru version number. You can also use the short form, -v.

Servermanagercmd is deprecated, and is not guaranteed to be supported in future releases of Windows. We recommend that if you are running Správce serveru on computers that are running Windows Server® 2008 R2, you use the Windows PowerShell cmdlets that are available for Správce serveru. 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.

ImportantDůležité
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.

The following example shows how to use servermanagercmd to display a list of all Role, služby rolí a funkce available, and which Role, služby rolí a funkce 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 Role, služby rolí a funkce 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

  • For a complete list of the Role, služba role a funkce identifiers you can specify for the Id parameter, or more information about using an XML answer file with Servermanagercmd, see the Server Manager Help. (http://go.microsoft.com/fwlink/?LinkID=137387).

  • See Server Manager cmdlets for a listing of Windows PowerShell cmdlets that are available for Správce serveru.

  • Command-Line Syntax Key

Byl tento obsah pro vás užitečný?
(Zbývající počet znaků: 1500)
Děkujeme za váš názor.

Obsah vytvořený komunitou

Zobrazit:
© 2014 Microsoft