views:

34

answers:

1

Hi there,

I want to control, configure and manipulate IIS 6.0 and later versions via ASP.Net web application using WMI and .Net.

  1. Can i use a mix of Microsoft.Web.Management and System.DirectoryServices?
  2. Is there a difference between the two?
  3. Will System.DirectoryServices be supported for later versions of IIS. i.e IIS 7.0+ ?
  4. Where is the better of the two and why (considering the objective in line #01)?

Thanks a lot.

Regards

+1  A: 

You can't use the Microsoft.Web.Administration namespace to configure and manage IIS6. Your options from a .NET perspective are System.DirectoryServices, WMI or, if you're feeling really adventurous ABO (IIS Admin Base Objects).

In IIS7 you can use Microsoft.Web.Administration and the other IIS7 Managed Code Administration libraries, in fact this is the preferred method because these components are fully aware of all of the new IIS7 features.

If you have some legacy code or tools that you don't have time to port, or can't (because you don't have access to the source), you can install the IIS6 compatibility components. These provide you with access to the old style ADSI API which System.DirectoryServices and WMI wrap. In fact these also install the old ADSUTIL.vbs script which is used to perform various management tasks on IIS6.

The IIS6 compatibility components on IIS7 simply wrap access to the IIS7 management libraries. They do a fairly good job, but are not aware of new management features that exist in IIS7 but not in IIS6.

So in a nutshell, in an ideal world you should continue to manage IIS6 using System.DirectoryServices or WMI. For IIS7 your preference should be Microsoft.Web.Administration and its friends.

Kev