Installing IIS 7.0 using ServerManagerCmd.exe

Posted: Apr 13, 2007  5 comments

Average Rating

Tags
IIS News Item

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

  1. Install IIS 7.0 using ServerManagerCmd at IIS Digest
    April 18, 2007

    PingBack from http://www.iis-digest.com/?p=309

  2. bills
    April 22, 2007

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

  3. Hiroshi Okunushi's Blog ☆ミ
    April 26, 2007

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

  4. Jose Barreto
    July 28, 2007

    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

  5. Microsoft IT Professional Blog » The Servermanager.exe CLI tool in Windows Server 2008
    February 20, 2008

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

Page view counter