I am trying to create a list of all virtual directories within an IIS site. However, I have found that trying to do this varies dramatically in the older versions of IIS. In IIS 7 this is a relatively easy task via C# but I can't seem to find a good method for doing this in IIS 6 and 5.
I have tried using the System.DirectoryServices.DirectoryEntry but that doesn't seem to give me the desired output.
I am the server administrator so I'm open to using other things such as .vbs files that are built into IIS as well as writing my own code.