WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Virtual directories on IIS via ADSI

Keywords:   Virtual directories on IIS via ADSI

Question:

Is there a function in Winbatch that will allow me to create a virtual directory under ISS. I need to scrip this somehow since I have to do this for 700 web servers.

Answer:

Here's the code I use to create virtual directories for our IIS FTP server...
AddExtender("WWADS34I.dll") ; ADSI Extender 

VirtualDir = "Whatever"
NewDir = "Path/To/Physical/Directory"

if dsisObject(StrCat("IIS://Localhost/MSFTPSVC/1/ROOT/",VirtualDir))
dsDeleteObj(StrCat("IIS://Localhost/MSFTPSVC/1/ROOT/",VirtualDir))
endif

NewObject = dsCreateObj("IIS://Localhost/MSFTPSVC/1/ROOT","IIsFtpVirtualDir",VirtualDir)

dsSetProperty(NewObject,"Path",NewDir) ; Path to directory
dsSetProperty(NewObject,"AccessFlags",3) ; Read and write access
dsSetProperty(NewObject,"AccessRead",-1) ; Read Access = TRUE
dsSetProperty(NewObject,"AccessWrite",-1) ; Write Access = TRUE
dsSetProperty(NewObject,"DontLog",0) ; DontLog = FALSE
dsSetObj(NewObject) 

Article ID:   W15394
File Created: 2003:05:13:11:27:26
Last Updated: 2003:05:13:11:27:26