Determine if an IIS website or IIS virtualdirectory exist, that run under a given applicationpool, with C#
To call this function use: DoesAppPoolHaveWebsites(new DirectoryEntry(string.Format("IIS://{0}/w3svc", "localhost")), "appPoolName") /// <summary> /// Determine if a IIS website running under an applicationpool exists. /// </summary> /// <returns></returns> public bool DoesAppPoolHaveWebsites(DirectoryEntry iisEntry, string appPoolName) { bool