Hi,
I use code like the following in ASP.Net to enumerate the websites in IIS:
string metabasePath = "IIS://localhost/W3SVC";
DirectoryEntry service = new DirectoryEntry(metabasePath);
service.RefreshCache();
string className = service.SchemaClassName.ToString();
if (className.EndsWith("Service"))
{
DirectoryEntries sites = service.Children;
foreach (DirectoryEntry site in sites)
{
ProcessSite(site);
}
}
However, I find that only the first 11 sites out of 16 sites are ever processed. I have fought with this for a few hours, and cannot find any way to get past the first 11 sites in IIS. I've tried searching recursively, I've tried using the DirectorySearcher to no avail, I've tried enumerating multiple times or using some sort of a filter without any luck.
Any ideas?
Thanks!
~ mellamokb