IIS.VirtualDir.Create
Top  Previous  Next


Creates FTP or web virtual directory on IIS 4.0, 5.0 and 6.0

Preparations
·Before creating any virtual directories - set FTP / IIS permissions and other properties at the site root level - all values will be inherited when the virtual directories are created.  
·Physical directories must also be created before creating virtual directories. Use "DOS md" to create the physical directory, example "DOS md e:\users\%AccountName%\www".  

FTP hints
·In order for an FTP home directory to be mapped correctly when a user logs on it has to have exactly the same name (case sensitive) as the user.  
·Set user NTFS permissions to no access on the site root directory to prevent users from going up a directory level and seeing all other users home directories.  
·Remember that FTP passwords are sent in clear text over the Internet. Do not allow FTP access for sensitive accounts.  

Category
IIS

Script section
[Batch], inside Data.Loop..EndLoop statement

Requirements

·ADSI2.5  

IIS.VirtualDir.Create Type, Server, SiteNumber, VirtualDirName, Path

Type
Options: FTP | Web  
·FTP - create FTP directory  
·Web - create web directory  

Server
IIS Server Name  

SiteNumber
Site number in IIS installation  

VirtualDirName
Name of virtual directory  

Path
Physical path  

Examples
1) Create the virtual directory "steve" in the first Web site on server "\\x5012b" and let it point to "e:\users\steve\www"

IIS.VirtualDir.Create Web, x5012b, 1, steve, e:\users\steve\www

2) Create physical directories and web virtual directories for accounts listed in [data] column 3, copy the file "default.htm" to all directories

DOS md e:\users\%col3%\www
DOS copy c:\web\new\default.htm e:\users\%col3%\www
IIS.VirtualDir.Create Web, %servername2%, 1, %col3%, e:\users\%col3%\www


3) Create default FTP virtual home directory for user "steve"

IIS.VirtualDir.Create FTP, x5012b, 1, steve, e:\users\steve\ftp