hi guys,

few days back i've posted a question regarding how can i get the list
of the websites form the IIS, at this location:

http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/97f4f07b8b46a397/41372cde30df29e7?lnk=st&q=how+to+get+list+of+websites+from+IIS+C%23&rnum=1&hl=en#41372cde30df29e7

and i got a nice replay. it worked.

now the problem is different when i tried the code on the different
webserver which has lots of websites but not under the "Default Web
Site" directory. most of the Websites are under the "Web Sites" folder.
and now i want to retrive all those websites list from the IIS. i tried
to get the type of the folder "Web Sites", but i didnt get anything out
of it.

can anyone tell me how can i get all of the websites from the folder
called "Web Sites".

Tools:
IIS 5.1 on Microsoft Windows Server 2003
C#.net 2005

thanks,
Lucky

Re: Getting list of Website from IIS "Web Sites" Folder by Halcyon

Halcyon
Wed Oct 18 06:13:58 CDT 2006

David Wang's blog might be able to help you:

http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO_Enumerate_IIS_Website_Configuration.aspx


"Lucky" <tushar.n.patel@gmail.com> wrote in message
news:1161165563.012570.50720@i3g2000cwc.googlegroups.com...
> hi guys,
>
> few days back i've posted a question regarding how can i get the list
> of the websites form the IIS, at this location:
>
> http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/97f4f07b8b46a397/41372cde30df29e7?lnk=st&q=how+to+get+list+of+websites+from+IIS+C%23&rnum=1&hl=en#41372cde30df29e7
>
> and i got a nice replay. it worked.
>
> now the problem is different when i tried the code on the different
> webserver which has lots of websites but not under the "Default Web
> Site" directory. most of the Websites are under the "Web Sites" folder.
> and now i want to retrive all those websites list from the IIS. i tried
> to get the type of the folder "Web Sites", but i didnt get anything out
> of it.
>
> can anyone tell me how can i get all of the websites from the folder
> called "Web Sites".
>
> Tools:
> IIS 5.1 on Microsoft Windows Server 2003
> C#.net 2005
>
> thanks,
> Lucky
>



Re: Getting list of Website from IIS "Web Sites" Folder by Kristofer

Kristofer
Wed Oct 18 13:02:53 CDT 2006

Hello,

There is no IIS 5.1 on Windows Server 2003, it is either IIS 6.0 on
Windows Server 2003 or IIS 5.1 on Windows XP.

Anyway, i think this code snippet works on both:

"C# - Enumerate websites"
http://www.gafvert.info/iis/article/cs_enum_iis_websites.htm

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Lucky wrote:

>hi guys,
>
>few days back i've posted a question regarding how can i get the list
>of the websites form the IIS, at this location:
>
>http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/97f4f07b8b46a397/41372cde30df29e7?lnk=st&q=how+to+get+list+of+websites+from+IIS+C%23&rnum=1&hl=en#41372cde30df29e7
>
>and i got a nice replay. it worked.
>
>now the problem is different when i tried the code on the different
>webserver which has lots of websites but not under the "Default Web
>Site" directory. most of the Websites are under the "Web Sites" folder.
>and now i want to retrive all those websites list from the IIS. i tried
>to get the type of the folder "Web Sites", but i didnt get anything out
>of it.
>
>can anyone tell me how can i get all of the websites from the folder
>called "Web Sites".
>
>Tools:
>IIS 5.1 on Microsoft Windows Server 2003
>C#.net 2005
>
>thanks,
>Lucky