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.
views:
146answers:
3
+1
A:
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
}
Grzenio
2009-07-01 10:28:01
A:
C# example: link text
or
This is a VB example, but I think you will use this idea: link text
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery("Select * from IIsWebVirtualDir")
For Each objItem in colItems
Wscript.Echo "Application Isolated: " & objItem.AppIsolated
Wscript.Echo "Application Package ID: " & objItem.AppPackageID
Wscript.Echo "Application Package Name: " & objItem.AppPackageName
Wscript.Echo "Application Root: " & objItem.AppRoot
Wscript.Echo "Installation Date: " & objItem.InstallDate
Wscript.Echo "Name: " & objItem.Name
Next
Icebob
2009-07-01 10:38:21
That script lists Vdirs, not Web sites.
Cheeso
2009-07-15 12:40:41
Really, sorry man
Icebob
2009-07-16 06:46:09
A:
In addition to above solutions, assuming if your application is not running on the same server machine where the IIS is, in that case you will need to write a TCPClient to perform Reverse DNS on the IP of the IIS server.
By defination Reverse DNS means:
In computer networking, reverse DNS lookup or reverse DNS resolution (rDNS) is the determination of a domain name that is associated with a given IP address using the Domain Name System (DNS) of the Internet.
this. __curious_geek
2009-07-01 10:47:20