Provisioning Options in IIS 7

by Walter Oliver

Options Table

There are a number of ways to create and manage web sites. The following table lists the options that are currently available along with the advantages and disadvantages of each.

Method of Provisioning Description Advantages Disadvantages
User Interface (UI) /Remote Delegation Use IIS Manager, the management user interface that comes with IIS, to configure the most common properties in the applicationhost.config. Open the property sheets for a service, site, or virtual directory and change values. Changes take place immediately without a need to stop and start the server. When you create a site or virtual directory, or when you configure a feature with more than one property, the IIS Manager user interface sets all the supporting properties. IIS Manager informs you if a new value is invalid. Managing large IIS server configurations or multiple servers over the Internet can be slow and cumbersome. Not all configuration properties can be accessed in the user interface.
Text Editor Use a text editor such as Notepad to directly edit the applicationhost.config file while IIS is running. Entries are case-sensitive. You can change multiple properties or create new nodes in one instance without having to open and close multiple property sheets. It is easy to corrupt an IIS server by using edit-while-running. If your edits include XML that is not formatted correctly, IIS cannot read the applicationhost.config and the last history file must be restored. If your edits include an invalid configuration that does not comply with the rules in the schema, an error is logged in the event viewer, but the rest of IIS can run. Property inheritance must be taken into consideration when cutting and pasting portions of the applicationhost.config. The section you paste might inherit properties from parent nodes and impart properties to child nodes. If you are using edit-while-running over the network and the connection fails, you might end up with an invalid applicationhost.config. Using edit-while-running on multiple servers in a Web farm takes as much time as using the user interface.
AppCmd.exe Use command line tool to quickly make configuration changes on an IIS server. The tools were developed to provide solutions to the most popular administration tasks. ?
Active Directory Service Interfaces (ADSI) Use ADSI to programmatically configure IIS in a script or compiled program. Changes take place immediately without a need to stop and start the server. Configuring large sites or multiple servers with ADSI is fast and efficient. ADSI is scriptable. You can configure IIS 4.0, IIS 5.0, IIS 5.1, and IIS 6.0, IIS 7.0 with IIS 6.0 compatible mode enabled with ADSI, as long as you use error checking that can handle missing objects and properties. You can extend the IIS schema with ADSI, though it is not recommended. If you create a site or virtual directory, or use a property that depends on others, you must ensure that you know which supporting properties need to be created and set as well. Only available for IIS 7.0 if IIS 6.0 compatible mode is enabled. Difficult to use.
Windows Management Instrumentation (WMI) Use WMI to programmatically configure IIS in a script or compiled program. Changes take place immediately without stopping and starting the server. Configuring large sites or multiple servers with WMI is fast and efficient. WMI is scriptable. If you create a site or virtual directory, or use a property that depends on others, you must ensure that you know which supporting properties need to be created and set as well. Difficult to use.
Admin Base Objects (ABO) Use ABO to programmatically configure IIS in a compiled program written in C, C++, or Visual Basic 6.0. It is faster than using ADSI or WMI because the ADSI and WMI providers are wrappers for ABO. If you create a site or virtual directory, or use a property that depends on others, you must ensure that you know which supporting properties need to be created and set as well. ABO is not scriptable. ABO applications can only be written in C++ or Visual Basic 6.0. Since ABO accesses IIS at the lowest level, it is more difficult to use than ADSI or WMI because there are no methods that compress multiple lines of ABO code into one method call. Also, there are no safeguards to prevent you from configuring invalid settings. Not available for IIS 7.0.
Managed API: Use managed APIs in Microsoft.Web.Administration to programmatically configure IIS in any .net application. Configuring large sites or multiple servers is fast and efficient. Managed, fastest and remoteable using RPC. MWA can create 100,000 sites within 62 seconds (1600 sites/sec) Only can be used on Windows platform. Many objects are not exposed as strong typed objects, you have to understand the lower APIs to enable to configure certain objects, and properties. Requires RPC for remote server configuration.
OLE Automation: OLE Automation ProgId=Microsoft.ApplicationHost.WritableAdminManager, can be used from Jscript and VBScript. Configuring large sites or multiple servers is fast and efficient. Actually slightly faster than MWA; it is also remoteable. Need to understand the lower APIs to enable to configure certain objects and properties. Requires RPC for remote server configuration.