Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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)