Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

php save mails as eml, WWWXXXAPC, sqlexpress database file auto-creation error, sqlexpress database file auto-creation error, dbf2mysql parameter, wwwxxxAPC, How to unsubscrube from dategen spam, docmd.close 2585, WWWXXXDOCO, nu vot

Links

XODOX
Impressum

#1: Finding IIS home directory with getObject

Posted on 2007-06-01 22:28:41 by Steve Ricketts

I would like to enumerate the web sites on a server and find the physical
directory for each. I can enumerate them with the following code:

set objW3 = getObject("IIS://localhost/W3SVC")
for each webSite in objW3
webSite.ServerComment 'Web site name
next

But I can't figure out what property to use to find the file path.
webSite.Path creates an error.

Can anyone point me in the right direction? And if this is not the proper
forum to ask the question, you could direct me to the proper forum.

Many thanks,

Steve

Report this message

#2: Re: Finding IIS home directory with getObject

Posted on 2007-06-02 06:48:41 by Ken Schaefer

From memory

..ServerComment is stored as an attribute of the website. However .Path is an
attribute of the "Root" node located underneath the website. So you may need
to get a handle to the root node first.

Cheers
Ken


"Steve Ricketts" <Velocedge@hotmail.com> wrote in message
news:%23GNE0tIpHHA.3368@TK2MSFTNGP02.phx.gbl...
>I would like to enumerate the web sites on a server and find the physical
>directory for each. I can enumerate them with the following code:
>
> set objW3 = getObject("IIS://localhost/W3SVC")
> for each webSite in objW3
> webSite.ServerComment 'Web site name
> next
>
> But I can't figure out what property to use to find the file path.
> webSite.Path creates an error.
>
> Can anyone point me in the right direction? And if this is not the proper
> forum to ask the question, you could direct me to the proper forum.
>
> Many thanks,
>
> Steve
>

Report this message

#3: Re: Finding IIS home directory with getObject

Posted on 2007-06-02 13:07:33 by Steve Ricketts

I guess that's part of my problem. I know how to get the root node of one
web using something like:

set objWebsite = getObject("IIS://localhost/W3SVC/1/Root")
sDirectory = objWebsite.Path

But I don't know how to get the other sites. I thought incrementing the 1
would make sense but that didn't work. So, if I have the Website object.
how do I get it's root node from that object?

Thanks for the help, very much appreciated.

Steve


"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:uEumMFNpHHA.1240@TK2MSFTNGP06.phx.gbl...
> From memory
>
> .ServerComment is stored as an attribute of the website. However .Path is
> an attribute of the "Root" node located underneath the website. So you may
> need to get a handle to the root node first.
>
> Cheers
> Ken
>
>
> "Steve Ricketts" <Velocedge@hotmail.com> wrote in message
> news:%23GNE0tIpHHA.3368@TK2MSFTNGP02.phx.gbl...
>>I would like to enumerate the web sites on a server and find the physical
>>directory for each. I can enumerate them with the following code:
>>
>> set objW3 = getObject("IIS://localhost/W3SVC")
>> for each webSite in objW3
>> webSite.ServerComment 'Web site name
>> next
>>
>> But I can't figure out what property to use to find the file path.
>> webSite.Path creates an error.
>>
>> Can anyone point me in the right direction? And if this is not the
>> proper forum to ask the question, you could direct me to the proper
>> forum.
>>
>> Many thanks,
>>
>> Steve
>>
>

Report this message

#4: Answer: Finding IIS home directory with getObject

Posted on 2007-06-02 18:05:06 by Steve Ricketts

Ok, Ken's comments were enough for me to figure it out. Here's how you
enumerate the web sites and then retreive the site's path.

set objW3SVC = getObject("IIS://localhost/W3SVC")
for each IISwebSite in objW3SVC
debug.print IISwebSite.ServerComment 'Web site name
set objWeb = getObject(IISwebsite.adsPath & "/Root")
rootPath = objWeb.Path
next

Thanks for the pointers Ken!

Steve

"Steve Ricketts" <Velocedge@hotmail.com> wrote in message
news:%23GNE0tIpHHA.3368@TK2MSFTNGP02.phx.gbl...
>I would like to enumerate the web sites on a server and find the physical
>directory for each. I can enumerate them with the following code:
>
> set objW3 = getObject("IIS://localhost/W3SVC")
> for each webSite in objW3
> webSite.ServerComment 'Web site name
> next
>
> But I can't figure out what property to use to find the file path.
> webSite.Path creates an error.
>
> Can anyone point me in the right direction? And if this is not the proper
> forum to ask the question, you could direct me to the proper forum.
>
> Many thanks,
>
> Steve
>

Report this message