Share via


The Windows Vista and Windows Server 2008 Developer Story: IIS Manager

 

Microsoft Corporation

April 2006
Revised January 2007

The Windows Vista and Windows Server 2008 Developer Story includes content for developers, and other technology experts and managers, interested in an in-depth exploration of some of the new and extended features in Windows Vista. It is released to the Windows Vista Developer Center in the form of Articles, published approximately one every two weeks. Those Articles are only a summary of the Windows Help file, which can be downloaded here.

Note   To provide feedback about the articles, please send e-mail to Vistadev@microsoft.com.

Contents

Introduction
Web Management Framework Architecture
Web Management Framework Development
In Depth: Extending the Web Management Framework
See Also

Introduction

IIS 7 includes a new version of the IIS Manager (previously known as the "Web Management Tool") that has been updated to better support the power of IIS 7. Some of the improvements in the IIS Manager include:

  • Consolidated management of IIS and ASP.NET applications.
  • The IIS Manager can be run as a standalone application or within the Microsoft Management Console (MMC), as a MMC snap-in.
  • An improved UI that provides more consistency, and better navigation and selection features. The UI will include a customized treeview navigation pane that includes a command bar, breadcrumbs, and consolidated management of many types of information, including configuration data, content, runtime state, provider, and operation data.
  • Administrative rights can be delegated (on a per-computer, web application, or web site basis) to users that do not have administrative rights to the local computer. This capability is made possible by two new features of IIS 7: administrator lists and feature delegation.
  • Ability to administer both local and remote application servers. The IIS Manager supports forms, basic, and Windows authentication modes.
  • Better support for staging and Web farms.
  • Support of secure communications and the validation of configuration changes before they take effect.
  • Support for multiple versions of the Common Runtime Library (CLR), required for robust ASP.NET management.
  • The IIS Manager is built upon the Web Management Framework, which is composed of a set of standard modules built upon the .NET Framework 3.0 managed classes. Web Management Framework provides developers with the following benefits:
    • Web servers, sites, and applications can be managed by calling into the Web Management Framework.
    • Web Management Framework's extensible object model enables developers to add classes and properties that are managed alongside built-in types. Managerial processes built as Web services can be integrated into the IIS Manager (or another Web Management Framework-compatible tool).
    • Web Management Framework has client UI components that can be hosted within other applications and tools.

The following picture depicts the IIS Manager displaying the sites on the current Web server.

Web Management Framework Architecture

Web Management Framework was designed to support a distributed, client-server architecture built upon the following primary components:

Web Management Framework Component Description
Web management client The application that hosts the client UI (for example, the IIS Manager, MMC, or Visual Studio). Each client contains a connection manager which connects to the web management server and manages the set of active connections.
Web management components A collection of Web Management Framework objects that implement the client-side functionality and UI, and allow for extensibility.
Web management server A standalone instance of a Web server that is used solely for remote, delegated management. The client communicates with this server via HTTPS. It has the ability to operate in two modes: local only (the default), or local and remote.
Core web server The web server that runs the sites and applications that are being managed. During the course of running, it accesses the content and provider data, and updates its runtime state, and generates operational data.

Web Management Framework was designed around the concept of a connection, which represents a single management session for a specific management unit: a specific app, a site, or the server under a specific CLR version.

Each connection logically contains one or more modules, which represent the available set of management features, and typically include associated client-side UI functionality. In general, the module code on the client does not interact directly with management configuration and information on the core web server. Instead, all queries and modifications to management information are performed via calls to the associated module service.

A module service is a Web service that executes on the web management server, and is invoked by client modules to implement the associated management functionality. Each module service is associated with a module provider, which is a server-side entity that determines whether a specific module is enabled or disabled based on context information provided by the management client.

Management modules providers can be selectively enabled or disabled for an application, site, or server. They are the basis of the extensibility model in the design structure. If a client does not have the executable for a specific module that has been enabled for the current connection, the client code will automatically be downloaded. This forms the mechanism by which the client can be updated with newer versions of modules, and extended with new modules.

The following diagram details how these concepts and architecture interact:

Web Management Framework Development

The Web Management Framework includes a client-side UI model based upon a Web browsing metaphor: functionality is modeled in the form of pages that can be navigated back and forth (for example, via links and the back/forward buttons). In addition to browsing, the user interface is a task-oriented one, as opposed to property-oriented. Changes to the configuration and management information are primarily performed through tasks.

Features are implemented in the form of pages. A page is implemented as a UI control class that also implements the IModulePage interface. Pages and modules offer tasks by implementing Task Lists (class TaskList) and Task Items (TaskItem) to allow the administrator to perform management activity. Modules register feature categories, and features within them by using the IControlPanel service.

The environment offers a number of services for use by pages. These services are available via the IServiceProvider reference provided to the page during its initialization. For example, the Connection represents the current connection associated with the management session, which enables creating Web service proxies, opening related connections, etc.

The Web Management Framework API is divided into the following four portions:

  • The server defines the operation of the Web management server.
  • The client defines client-side portions, including the Web management clients and their components.
  • The hosting environment enables the core user interface and functionality contained within the client to be hosted in different shells, such as the IIS Manager and MMC.
  • The configuration portion enables limited configuration of the server, as well as the associated administrators.

The following sections list many of the primary public interfaces, classes, and enumerations available in these portions of the Web Management Framework.

Server Framework Resources

.NET Framework 3.0 Namespace Module
Microsoft.Web.Management.Server Microsoft.Web.Management.dll
Interface Description
IManagementContext Encapsulates context information that is made available to both the module provider and module services. Provides information about the client (for example, name and the CLR version being used).
Class Description
ModuleService The base class for implementing new management (extension) modules. This class provides the current management context.
ModuleProvider The base class for implementing management module providers. These supply information about a management module, including its module service type, the location of the management module code, etc. These classes represent the main registration point for all features, and should be registered in the file administration.config inside the inetsrv directory.
ModuleDefinition Encapsulates information about a specific management module for use on the server, such as its name, associated service type, etc.
ModuleInfo Encapsulates information about a specific management module that is sent to the client, such as its name, associated service URL, the assembly containing the module, etc.
ManagementUnit Encapsulates contextual information about the management unit currently being managed during the execution of a Web service method on a module service. This class is also used to retrieve configuration of the management unit.
ServerManagementUnit Encapsulates contextual information about a server being managed, such as the computer name.
ApplicationManagementUnit Encapsulates contextual information about an application being managed, such as the application name, its virtual path, and containing site.
SiteManagementUnit Encapsulates contextual information about a site being managed.
ManagementConfiguration Encapsulates a configuration loaded from a ManagementUnit. This class allows access to configuration sections, abstracts of the various configuration files on the server (root web.config and iis.config), the update configuration, etc.
RemoteObject The base class for remotable objects that are created in an ASP.NET app-domain representing the application being managed.
TypeInformationGenerator The base class for implementing a type information generator, which generates information about types within an app-domain representing the application being managed so that it can be marshaled back to the module service running in the default app-domain.
Enumeration Description
ManagementScope Defines the various types of management units supported by the environment, such as folder, application, site, and server.
ModuleProviderPriority Allows a module provider to indicate relative priority of its associated module in the merged list of server and modules.

Client Framework Resources

.NET Framework 3.0 Namespace Module
Microsoft.Web.Management.Client Microsoft.Web.Management.dll
Interface Description
IModulePage, IModuleChildPage The interfaces for a page, and a child page of the client UI for a connection. A child page is a page that isn't directly navigable to (it does not appear in the control panel) but instead is navigated to from a page that does show up in the control panel.
IConnectionManager Represents a module service that manages connections, including active, new, and serialized (favorites) connections.
INavigationService Enables navigating between different pages within the user interface.
IPreferencesService Enables access to and storing of per-user preferences.
IControlPanel Enables access to the available features in a connection and is used to generate the control panel UI. Each feature is mapped to a particular page.
IExtensibilityManager Enables extension modules to register their functionality so they can be presented in an integrated manner in the appropriate context.
Class Description
Module The base class for implementing the UI for the extension module client.
ModulePage The base class for implementing a page of the client UI for a connection.
ModuleListPage The base class for a module page that contains a listing.
ModuleListPageSearchFieldModuleListPageSearchOptions

ModuleListPageSearchGroupingModuleListPageFilter

A set of classes that define characteristics for a ModuleListPage.
ModuleDialogPage The base class for a module page with dialog-like semantics.
Connection The class for a connection, which represents an active management session.
ConnectionInfo Encapsulates, in a serializable form, information about a connection.
ConnectionEventArgsConnectionEventHandler Classes that support connection events.
NavigationEventArgsNavigationEventHandler Classes that support navigation events.
TaskListTaskItem

PropertyTaskItem

MethodTaskItemBase

MessageTaskItem

TextTaskItemBaseGroupTaskItem

Classes that support the task-based user interface and command processing architecture of Web Management Framework.
Enumeration Description
ModuleListPageViewModes

ModuleListPageSearchModes

Define behaviors for a ModuleListPage.

Hosting Framework Resources

.NET Framework 3.0 Namespace Module
Microsoft.Web.Management.Host Microsoft.Web.Management.dll
Microsoft.Web.Management.Client Microsoft.Web.Management.dll
Interface Description
IManagementHost Identifies the host of a Web Management Framework. Each host will have a different implementation of this interface.
IManagementUIService Enables Windows Forms-based hosts to launch the UI associated with service modules, such as dialogs, message boxes, progress indicators, etc.
IConnectionBuilder Launches the connection and logon UI of the host.
IHelpService Launches the help UI of the host.

In Depth: Extending the Web Management Framework

The following steps are used to introduce a new management feature using the extensibility mechanisms of the environment:

  1. Implement the core functionality of the extension in two parts, as a module service and a module provider.

    • The module service for the extension is implemented in a class derived from ModuleService. Implement the desired methods and properties, and annotate the publicly-accessible members with the ModuleServiceMethodAttribute to expose their functionality.
    • The module provider is implemented in a class derived from ModuleProvider. Implement a GetModuleInfo method to determine if the extension module is to be enabled or disabled. This method returns a ModuleInfo object that provides information about the server-side module service code and about the client-side code.

    The following code is an example of security module service and provider:

    namespace Microsoft.Web.Management.WebPackage.Security {
        public sealed class SecurityModuleService : ModuleService 
        {
            [ModuleServiceMethod]
            public SecurityInfo GetSecurityInfo() 
            {
                // Use configuration API, etc. to implement.
            }
        }
        public sealed class SecurityModuleProvider : ModuleProvider 
        {
            public override ModuleInfo GetModuleInfo 
                           (ModuleProviderContext context) 
            {
                //Return a ModuleInfo if the SecurityModule is 
                // to be enabled.
            }
        }
    }
    
  2. Define the extension module client UI by implementing a class that derives from Module. In this class, implement the Initialize method to register the features with the IControlPanel service to provide the tool with the user interface to populate the tool. Implement (using the client classes and services) the user interface pages, dialogs, and tasks that work against the Web service implemented in step 1.

    The following code example demonstrates:

    namespace Microsoft.Web.Management.WebPackage.Security {
    
        public sealed class SecurityModule : Module 
        {
            public override void Initialize(IServiceProvider
                         serviceProvider, ModuleInfo moduleInfo) 
            {
                base.Initialize(serviceProvider, moduleInfo);
                //Retrieve the IControlPanel service, and register the
                // associated pages to be shown in the management tool.
            }
            // Optionally provide a module-scoped task list etc.
        }
        internal sealed class UsersModulePage : ModuleListPage 
        {
            //Implement the user interface of the page, associated 
            // task list etc.
        }
        internal sealed class RolesModulePage : ModuleListPage 
        {
            //Implement the user interface of the page, associated 
            // task list etc.
        }
    }
    
  3. Deploy the assemblies containing the module service and provider classes to the GAC on the server. Deploy the assembly containing the client UI to the GAC on the server (so it can be used in local connections, and streamed to the client as needed for remote connections).

  4. Register the module provider in the administrative configuration file, administration.config. The following configuration entry would be appropriate for the security module example:

    <configuration>
      <system.web>
        <management>
          <frameworkModules>
            <add
              name="Security"
              type="Microsoft.Web.Management.WebPackage.Security.  
                                       SecurityModuleProvider, ..." />
          </frameworkModules>
          <frameworkFeatures>
            <add name="Security" />
          </frameworkFeatures>
          ...
        </management>
      </system.web>
    </configuration>
    

See Also

Internet Information Services

Run-time Status & Control (RSCA) API

IIS Modules

HTTP Server API (coming soon)