Installing IIS 7.0 using ServerManagerCmd.exe

Posted: Apr 13, 2007  15 comments  

Average Rating

Tags
IIS News Item

Share this Post

ServerManagerCmd.exe is the new command line tool to install IIS on a Longhorn Server machine. The new tool makes easy to automate install tasks so that IIS and other roles/features can be installed on a longhorn server machine easily in scriptable manner.

 

ServerManagerCmd.exe comes with distinct advantages with respect to other command-line install tools available on longhorn server (i.e. pkgmgr.exe, ocsetup.exe). The top advantages could be summarized as:

1.       “–Query” switch enables querying available roles and features. It can also provide information on what’s currently installed on the machine (see below for example).

2.       “-WhatIf” switch will provide what would be installed without installing anything on the box. This could be useful determining what dependencies will get installed for particular role or features if chosen (see below for example).

3.       Automatic detection of dependencies and installing them without explicitly passing to the tool as command-line arguments.  

 

IIS7 make good use of componentized architecture and enable system administrators to select and install only needed features on the box. Currently IIS7 provides around 40 installable features for longhorn server editions. The goal of this blog to summarize some common install scenarios and provide simple answer files to install them using ServerManagerCmd.exe

 

As far as how to use ServerManagerCmd.exe, it is really easy. Please make sure that you have administrator privileges on the box before you start. As a warm-up, you can type following commands on command shell to see the info tool provides.

  • ServerManagerCmd.exe -help: This will show help information and available switches for the command-line tool. (Short form: -?)
  • ServerManagerCmd.exe -query: Display a list of all roles, role services, and features available and shows which are installed on this computer. (Short form: -q)
  • ServerManagerCmd.exe -install <Available Role/Feature Name> -whatif: Display the operations to be performed on the current computer that are specified (Short form: -w)
  • ServerManagerCmd.exe -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)

Common IIS Install Scenarios

For simplicity, we provide common IIS install options using an answer file (simple XML file format that ServerManagerCmd.exe accepts as input). Without further delay, let's start...

 

1. Static Content Web Server Install Scenario (a.k.a. Default IIS install)

Save following content as Default.xml in your local disk.

 

<ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">
        <Role Id="Web-Server" />
      </ServerManagerConfiguration>
 
    Run following on command-line: ServerManagerCmd.exe -inputPath Default.xml

 

2. Default IIS + FastCGI Install Scenario

Save the following content as Default_CGI.xml in your local hard disk.

 

   <ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">
      <Role Id="Web-Server" />
      <RoleService Id="Web-CGI" />
 </ServerManagerConfiguration>

 

Run following on command-line: ServerManagerCmd.exe -inputPath Default_CGI.xml

 

3. Default IIS + Classic ASP Install Scenario

Save the following content as Default_ASP.xml in your local hard disk.

 

<ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">

    <Role Id="Web-Server" />
    <RoleService Id="Web-ASP" />
    <RoleService Id="Web-Filtering" />
    <RoleService Id="Web-ISAPI-Ext" />
</ServerManagerConfiguration>

 

Run following on command-line: ServerManagerCmd.exe -inputPath Default_ASP.xml

 

 

4. Default IIS + ASP.Net Install Scenario

Save the following content as Default_ASPNET.xml in your local hard disk. 

 

<ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">

    <Role Id="Web-Server" />
    <RoleService Id="Web-ASP-Net" />
    <RoleService Id="Web-Net-Ext" />
    <RoleService Id="Web-Filtering" />
    <RoleService Id="Web-ISAPI-Filter" />
    <RoleService Id="Web-ISAPI-Ext" />
</ServerManagerConfiguration>
 

Run following on command-line: ServerManagerCmd.exe -inputPath Default_ASPNET.xml

 

5. FTP Publishing Scenario

Save the following content as Default_FTP.xml in your local hard disk. 

 

<ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">

    <Role Id="Web-Server" />
    <RoleService Id="Web-Ftp-Server" />
    <RoleService Id="Web-Ftp-Mgmt-Console" />
</ServerManagerConfiguration>

 

Run following on command-line: ServerManagerCmd.exe -inputPath Default_FTP.xml

 

6. Default IIS + Metabase Compatibility Install Scenario

Save the following content as Default_Compat.xml in your local hard disk 

 

<ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">

    <Role Id="Web-Server" />
    <RoleService Id="Web-Metabase" />
    <RoleService Id="Web-WMI" />
    <RoleService Id="Web-Lgcy-Scripting" />
</ServerManagerConfiguration>

 

Run following on command-line: ServerManagerCmd.exe -inputPath Default_Compat.xml

 

7. Full IIS Install Scenario

Save the following content as Full_IIS.xml in your local hard disk 

 

<ServerManagerConfiguration Action="Install" xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration/2007/1">

    <Role Id="Web-Server" InstallAllSubFeatures="true" />
</ServerManagerConfiguration>
 
Run following on command-line: ServerManagerCmd.exe -inputPath Full_IIS.xml
 
 
Uninstalling IIS
In all IIS install scenarios described above, following command can be used to uninstall IIS features from a longhorn server machine.
 
ServerManagerCmd.exe -remove Web-Server
 
Additional Information
  1. ServerManagerCmd.exe is only available on Longhorn Server Edition of Windows. It is not available on Vista SKUs or previous releases of Windows operating system.
  2. ServerManagerCmd.exe is a managed code application.
  3. ServerManagerCmd.exe application is located under %WinDir%\system32 path.

 

Comments

great post, I'll be referring to it often! :)  welcome to blogsphere -

Apr 22 2007 by bills

Virtualization、管理(田辺さん)、PowerShell、ターミナルサービスが目立って人が入っていたような気がしました。やはり関心高いですね。(^。^)y-.。o○ 私のIIS7.0もかなりの数のお客様がご入場くださいました。ありがとうございます!実はIISとしては今日米国で大きな動きがいくつかありましてその内容も盛り込もうとしたり、会場ではIIS7が初めてのお客様も多かった関係でやはり時間が足りないセッションになってしまったという反省をしております。もうそろそろIISだけで複数セッション必要な時期が来たと思っています

Apr 26 2007 by Hiroshi Okunushi's Blog ☆ミ

Check additional details about the roles available via Server Manager and ServerManagerCmd in Windows Server 2008 at

blogs.technet.com/.../changes-in-windows-server-2008-roles-and-features-from-the-beta-3-to-the-june-ctp.aspx

Jul 28 2007 by Jose Barreto

Pingback from  Microsoft IT Professional Blog &raquo; The Servermanager.exe CLI tool in Windows Server 2008

Feb 20 2008 by Microsoft IT Professional Blog » The Servermanager.exe CLI tool in Windows Server 2008

Uma boa pr&#225;tica que tem se difundindo nas empresas &#233; padroniza&#231;&#227;o da instala&#231;&#227;o

Dec 01 2008 by Artur Rodrigues - da teoria à prática

Pingback from  HOW TO: Perform An IIS 7 Automated Install | Digital Meld

Jan 21 2009 by HOW TO: Perform An IIS 7 Automated Install | Digital Meld

時間がある時によく質問のある内容を書きとめておこうと思います。今回はまずはIIS7に触れる上で最も最初にあたる壁、どうやってインストールするかです。コマンドラインなど、やる段階で「ここを参照すれば」とこの投稿を思い出してもらえるとうれしいです。

Mar 12 2009 by Hiroshi Okunushi's Blog ☆ミ

If this command "servermanagercmd -query iis.xml" generates an XML file, why is it not in a format that we can use to add or remove features? Like "servermanagercmd -install iis.xml" or "servermanagercmd -remove iis.xml"?

Mar 12 2009 by Madness80

Submit a Comment

  • Plain text is accepted.
  • URLs starting with http:// are converted to links.