Retrieving IIS information using ASP.NET 2.0 (Page 1 of 4 )
This article explains how to retrieve IIS information using ASP.NET 2.0.
A downloadable file for this article is available
here.
The entire demonstration solution has been developed using Visual Studio 2005 Professional Edition on Windows Server 2003 Standard Edition. Please note that I didn’t really test the solution on any of the other versions/editions of the similar suite of Microsoft products.
You need to refer/import all of the following namespaces before you proceed further:
Imports System
Imports System.Management
Imports System.Data
“System.Management” has to be added separately to the list of references (which does not come by default).
The components of IIS 6.0
Retrieving native information from IIS 6.0 is not a tedious task. In fact, we should know about certain namespaces and classes, which are mainly used to retrieve information about IIS. Even though the title of this article says “ASP.NET 2.0,” the techniques discussed here should also work with “ASP.NET 1.1” (even though I didn’t test it). If you come across any problems, please do post so that I can reply to you.
Even though it is not essential, it is worthwhile to speak a little about IIS version 6.0 in this context. IIS 6.0 is the next generation of web server available in the Windows Server 2003 platform. IIS 6.0 obviously provides several enhancements over IIS 5.0 that are mainly intended to increase reliability, manageability, scalability, and security. IIS 6.0 is a key component of the Windows Server 2003 application platform, using which you can develop and deploy high performance ASP.NET Web applications, and XML Web Services.
IIS 6.0 internally contains a component called HTTP.SYS. HTTP.SYS is a kernel-mode (OS level) HTTP listener that listens for incoming requests and queues those requests up on the appropriate queue. Kernel mode support is not available in IIS 5.0. Each request will be serviced by one application pool. An application pool in IIS 6.0 can contain one or more applications.
There exists another component called Web Administration Service, which is a user-mode configuration and process manager. The Web Administration Service component performs mainly Configuration and Process Management. Application pools are used to manage a set of websites and applications. IIS 6.0 can support up to 2,000 application pools per server, and there can be multiple application pools operating at the same time.
The following sections will help you to retrieve IIS information using ASP.NET. You should realize that ASP.NET is not the only way to retrieve such information. You can also use VBScript, VB6, ISMAPI, WMI etc technologies to retrieve the same information. But our focus will be only on ASP.NET at the moment.
Next: Retrieving basic IIS information using ASP.NET 2.0 >>
More IIS Articles
More By Jagadish Chaterjee