Sometime back I reviewed the few of the sample for automating task in IIS (6, 7.x) using MWA, WMI , ADSI. Here are the links to download the sample code (C#, VB.net) from OneCode site:
Read More @ ASPRangers