0

I have an IIS 6.0 website with very many subwebs and several application pools.

I would like help establishing which app pool each of the subwebs is in using c#.

I have looked at the DirectoryServices namespace but still not sure of what to do.

Any help is appreciated.

Thanks.

Matt Busche
  • 14,216
  • 5
  • 36
  • 61
Davie
  • 818
  • 3
  • 12
  • 24

1 Answers1

0

Have a peek at this question I realise this is for IIS7 but may be worth a try

ServerManager manager = new ServerManager();
    foreach (Site site in manager.Sites)
    {
        foreach (Application app in site.Applications)
        {

            if (app.ApplicationPoolName.ToString() == AppPoolName)
            {
                 string appname = app.Path;
            }
        }
    }
Community
  • 1
  • 1
John Mitchell
  • 9,653
  • 9
  • 57
  • 91