IIS Automation (5/6)

Getting the list of modules in C#

File: Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Web.Administration;

namespace IISModuleList
    class Program
        static void Main(string[] args)
            using (ServerManager serverManager = new ServerManager())
                Configuration config = serverManager.GetApplicationHostConfiguration();
                ConfigurationSection globalModulesSection = config.GetSection("system.webServer/globalModules");
                ConfigurationElementCollection globalModulesCollection = globalModulesSection.GetCollection();
                foreach (ConfigurationElement module in globalModulesCollection)

Getting the list of modules in C++

blog comments powered by Disqus

Copyright(c) 2006-2017 Xavier Leclercq | Privacy policy

Contact Us