extracting list of websites from IIS manager

  • Thread starter Thread starter Abhi
  • Start date Start date
A

Abhi

Hi-

I'm looking for C# code sample that will extract the list of websites
from the IIS manager. anyone?

Thanks!
 
hi,

Do you need a list of websites or web apps ( virtual dirs ) ?

You can find a list of virtual dirs in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Virtual
Roots

Regarding the list of web sites , it should be in the registry as well , but
I could not find it the last time I searched, I found an example at
http://www.windowsitpro.com/Article/ArticleID/21557/21557.html?Ad=1 that
explain how to do it, as my target machine was running XP pro, I could only
define a web site so I did not used it at the end :)



Also I think you can use WMI to get this info, but I'm not very sure of it.

Cheers,
 
Directing people to search the registry is in general a bad idea, the
locations of keys and data are not carved in stone and are not necessarily
the same on different OS versions. Treat the registry as a black box, unless
you are dealing with your own entries, and use the API's where available.
For managed code, the API's are found in System.DirectoryServices or prefer
System.Management over the former, as System.DirectoryServices (ADSI)
requires IIS to be installed at the client.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top