I'm using IIS 6 on Windows Server 2003. The vision is to create a directory of those applications, showing their urls (ports on Server) and names.
I haven't done it, but I believe you need to use the following WMI object:
DirectoryEntry w3svc = new DirectoryEntry(string.Format("IIS://{0}/w3svc", serverName));
foreach (DirectoryEntry site in w3svc.Children)
{
//these are the web sites, lookup their properties to see how to extract url
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With