Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

Retrieving IIS website name from W3SCVn id...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob Meade - 24 Oct 2005 04:18 GMT
Hi all,

I need to iterate through a directory on a server which contains a folder
for each of the websites within IIS, each directory has the name of the
website under IIS, the name being the W3SCVn id, the n being an identifying
number....is it possible to query IIS via .net to retrieve the website name
I've given the website, for example...

W3SCV1 - "Default Web Site"

Any suggestions welcomed.

Regards

Rob
xhead - 24 Oct 2005 04:43 GMT
I think I would go about it a little differently, I would try to use
the WMI provider for IIS to query IIS about the websites it hosts.

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/833
f75ec-41da-416c-8b44-d9cf069fc528.asp

(and its parent page) for further information about the IIS WMI
provider.

You should be able to access WMI from .NET through the classes in the
namespace System.Management. This looks like a promising article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conaccessingmanagementinformationwithsystemmanagement.asp


Mike
Rob Meade - 24 Oct 2005 05:05 GMT
>I think I would go about it a little differently, I would try to use
> the WMI provider for IIS to query IIS about the websites it hosts.

Hi Mike,

Many thanks for your reply and links - alas, not being that adept yet I
wasn't entirely sure what I was looking at. :o/

I have found out thus far that I could use DirectoryServices to query the
Active Directory, and IIS, but I haven't yet found an article that does what
I need, I've found a few that list the applications under a website, but not
websites under IIS if you know what I mean.

I'm already using some code to query the AD for nt user lookups, so was
hoping it might be similar (and thus I'd understand it!)...

Thanks again for your reply.

Regards

Rob
xhead - 24 Oct 2005 05:20 GMT
There's a ton of sample WMI queries included with PrimalScript, a
script editor tool you can download and run as a 45-day trial. Go to
www.primalscript.com and get any of the editions of PrimalScript there,
then look for the WMI Wizard when you get in there. The queries should
be usable inside .NET somehow.

Hey, I haven't done this particular thing either, but keep exploring
that IIS area in MSDN until you find what you need - with that and the
sample script code from PrimalScript, you oughta get there sooner or
later!

Mike
Rob Meade - 24 Oct 2005 05:48 GMT
>  Hey, I haven't done this particular thing either, but keep exploring
> that IIS area in MSDN until you find what you need - with that and the
> sample script code from PrimalScript, you oughta get there sooner or
> later!

Cheers :o)

Rob
xhead - 24 Oct 2005 05:23 GMT
Oh, how about this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/8b7
799c1-cebc-4b11-b3d5-34ab7b728077.asp


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.