Using ahadmin to read/write IIS configuration - part 1
The Application Host Administration API (ahadmin.idl) interface library can be accessed using native code and any COM-interop means like script or managed code. This blog post details how to use this interface in scripts (all samples are in javascript) to read/write IIS7 configuration information.
Read complete post at https://blogs.iis.net/ksingla/archive/2007/02/25/using-ahadmin-to-read-write-iis-configuration-part-1.aspx.
-Kanwal