Hell

I am a Vb,(5\6\net\Vbwscript), person, but new to IIS

If I go into the Internet Services Manager MMC, and I right click on one of the virtual directories, and then select properties, I can see, and modify the properties. How to access, and change, those properties in vbscript, or any VB product, (no ASP involved)

What I want to do is to deny Access to particular IP Addresses. I understand that because I am on a win 2000 system that I have to use ADSI instead of WMI, (because WMI is for IIS 6, win2003

Is there a "createobject" command that will give me some kind of intellisense related to the IIS API?

When I do the following..

set vdirObj=getobject("IIS://localhost/W3svc/1/root/VDirName"
wscript.echo vdirobj.pat

....it does not know the property 'Path'. Where is there documentation that will tell me what the property names are, (equate the IIS admin properties\virtual directory tab\local path text box, to path or whatever)

Are there any samples anywhere

Thank

Lou

Re: Vbscript IIS Properties by Andrey

Andrey
Tue Apr 27 12:14:13 CDT 2004

LouWho wrote:

> Hello
>
> I am a Vb,(5\6\net\Vbwscript), person, but new to IIS.
>
> If I go into the Internet Services Manager MMC, and I right click on one of the virtual directories, and then select properties, I can see, and modify the properties. How to access, and change, those properties in vbscript, or any VB product, (no ASP involved)?
>
> What I want to do is to deny Access to particular IP Addresses. I understand that because I am on a win 2000 system that I have to use ADSI instead of WMI, (because WMI is for IIS 6, win2003)
>
> Is there a "createobject" command that will give me some kind of intellisense related to the IIS API?
>
> When I do the following...
>
> set vdirObj=getobject("IIS://localhost/W3svc/1/root/VDirName")
> wscript.echo vdirobj.path
>
> ...it does not know the property 'Path'. Where is there documentation that will tell me what the property names are, (equate the IIS admin properties\virtual directory tab\local path text box, to path or whatever)?
>
> Are there any samples anywhere?
>
> Thanks
>
> Lou

This link may be helpful:

http://www.iisfaq.com/Default.aspx?tabid=2967

For more info:

http://www.iisfaq.com/Default.aspx?tabid=2538

-Andrey


RE: Vbscript IIS Properties by anonymous

anonymous
Wed Apr 28 09:36:02 CDT 2004

I finally found the properties, and everything else that I needed at ..
http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/windows2000/en/server/iis/htm/asp/adsi0ewj.ht

Select the Index, and enter 'ADSI

The samples are good, but not exactly correct...This is the code that I put together, and that work
---------------------------------------------------------------------------------------------
Dim secOb
Dim MyIPSe
Dim IPArra
Dim ArraySiz

Set secObj=GetObject("IIS://localhost/w3svc/1/root/vDirName"
If Err.Number <> 0 The
WScript.Echo Err.Description
End I
set MyIPSec = secObj.IPSecurity
If Err.Number <> 0 The
WScript.Echo Err.Description
End I
If (True = MyIPSec.grantbydefault) The
'do nothin
' WScript.Echo "grantbydefault = true
' MyIPsec.GrantByDefault=False
' secObj.IPSecurity = MyIPSe
' secObj.Setinf
Els
'grant by default must be set before you can den
'WScript.Echo "grantbydefault = false
MyIPsec.GrantByDefault=Tru
secObj.IPSecurity = MyIPSe
SecObj.SetInf
End I

IPArray = MyIPSec.IPDen
arraySize = UBound(IPArray
ReDim IPArray (ubound(IPArray)+3
'This is for network i
IPArray(ArraySize + 1) = "123.0.0.1
IPArray(ArraySize + 2) = "123.0.0.4
IPArray(ArraySize + 3) = "123.0.0.6
'these would be for Network Id, and, Subnet Mas
'IPArray(ArraySize + 1) = "123.0.0.1,123.0.0.2
'IPArray(ArraySize + 2) = "123.0.0.4,123.0.0.5
'IPArray(ArraySize + 3) = "123.0.0.6,123.0.0.7

MyIPSec.IPDeny = IPArra
If Err.Number <> 0 The
WScript.Echo Err.Description
End I

secObj.IPSecurity = myipse
If Err.Number <> 0 The
WScript.Echo Err.Description
End I
secObj.setinf
If Err.Number <> 0 The
WScript.Echo Err.Description
End I


-----------------------------------------------------------------------------------------------