Installing IIS 7.0 using ServerManagerCmd.exe
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.
2. Default IIS + FastCGI Install Scenario
Save the following content as Default_CGI.xml in your local hard disk.
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">
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">
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">
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">
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">
- 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.
- ServerManagerCmd.exe is a managed code application.
- ServerManagerCmd.exe application is located under %WinDir%\system32 path.