iisiis-7iis-6application-pool

Changing IIS 6/7 Application Pool settings programmatically


How can I programmatically change IIS application pools' settings and properties (for example: the Enable 32-Bit Applications setting)?

Are there reference guides on properties for IIS 6 or 7 on MSDN or Technet?


Solution

  • Try this on for size.

    DirectoryEntry root = this.GetDirectoryEntry("IIS://" + this.DomainName + "/W3SVC/AppPools");
      if (root == null)
            return null;
    
    List<ApplicationPool> Pools = new List<ApplicationPool>();
    ...