Udostępnij za pośrednictwem


Creating FTP Sites Using Iisftp.vbs

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You can use the command-line script iisftp.vbs, which is stored in systemroot\System32, to create File Transfer Protocol (FTP) site configurations on local or remote computers running a member of the Windows Server 2003 family with IIS 6.0. This command does not create or destroy content, but it sets up the directory structure and IIS configuration files.

When you use iisftp.vbs to create a new FTP site, you specify only the basic properties that are needed to create the site and identify its contents. Iisftp.vbs uses the same default properties that IIS Manager uses when establishing new FTP sites, and it adheres to the same rules for inheriting properties. To configure the more advanced properties of the FTP site, use IIS Manager.

Important

You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any parameters).

This topic includes the following information:

  • Syntax: The order in which you type a command and any arguments and options that follow it.

  • Parameters: The values that are given to variables in the command.

  • Examples: Sample code and an explanation of the results.

Syntax

iisftp /create Path SiteName iisftp /create Path SiteName[/b Port] [/i IPAddress] [/dontstart*] [*/isolation {AD|Local} [/ADdomain DomainName /ADadmin [Domain\]User /ADpass Password]] [/s Computer [/u [Domain\]User /p Password]]

Parameters

Path

Specifies the location of content files for the FTP site. The path must be local, such as C:\Projects\HTML. If the specified path does not exist, then iisftp.vbs creates the path.

The Path parameter must immediately precede the SiteName parameter in the command. Otherwise, iisftp.vbs does not interpret the site information correctly.

SiteName

Required. Specifies a name for the FTP site.

/b Port

Specifies a TCP port number for the FTP site. Port 21 is the default.

/i IPAddress

Specifies an IP address for the FTP site. The default is All Unassigned, which assigns to the site all of the IP addresses on the computer that are not assigned to other sites. Only one site on each IIS server can be set to All Unassigned.

/dontstart

Indicates that the FTP site should not be started automatically as soon as it is created, which is contrary to the IIS default.

/isolation {AD|Local}

Provides for one of two user isolation modes, AD (Active Directory) and Local. If the /isolation switch is not present, the site will not use user isolation.

/ADdomain DomainName

Only valid when the /isolation switch is set to AD. This value is the name of the Active Directory domain.

/ADadmin [Domain\]User

Only valid when the /isolation switch is set to AD. This value is the name of the administrator in the user, domain\user, or user@domain format.

/ADpass Password

Only valid when the /isolation switch is set to AD. This value is the administrator's password.

/s Computer

Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. The default is the local computer.

/u [Domain\]User

Runs the script with the permissions of the specified user account. This account must be a member of the Administrators group on the remote computer. By default, the script runs with the permissions of the current user of the local computer.

/p Password

Specifies the password of the user account that is specified in the /u parameter.

Note

Iisftp.vbs does not verify the port number or IP address of an FTP site, and it does not verify that these bindings are unique within the server. If you create a site with invalid or conflicting bindings, the site will not start.

Examples

Example 1

The following example creates the "Archive" FTP site on the local computer, and associates it with content in the D:\Public\Archives directory. The command omits all optional parameters and accepts the default values. The "Archives" subdirectory does not exist, so iisftp.vbs will create it in the "Public" directory.

iisftp /create D:\Public\Archives Archive

In response, iisftp displays the following message along with the basic properties of the new FTP site. In this example, "Server" represents the machine name where drive D: is found, "Site Name" is the name you assigned to your FTP site, "Metabase Path" represents the metabase key assigned by IIS and is analogous to a registry key in the system registry, "IP" is unassigned by default, "Port" is set to 21 by default, "Root" is the directory where the FTP files reside, and "Status" is set to "STARTED" by default.

Connecting to server ...Done.

Server = RESKIT

Site Name = Archive

Metabase Path = MSFTPSVC/1452008083

IP = ALL UNASSIGNED

Port = 21

Root = D:\Public\Archives

Status = STARTED

Example 2

The following example creates the "Drivers" FTP site configuration on a remote server. It associates the site with files stored in the C:\Public\Download directory on SVR16. The command uses the /i parameter to specify an IP address for the site and the /dontstart parameter to prevent the site from starting automatically. It uses the /s parameter to specify the remote computer, and the /u and /p parameters to run the script with the permissions of the user's administrator account.

iisftp /create C:\Public\Download Drivers /i 172.31.69.150 /dontstart /s SVR16 /u Admin6 /p p@ssWor#

In response, iisftp displays the following message along with the basic properties of the new FTP site. In this example, "Server" represents the server machine, "Site Name" is the name you assigned to your FTP site name, "Metabase Path" represents the metabase key assigned by IIS and is analogous to a registry key in the system registry, "IP" represents the assigned DNS address, "Port" is set to 21 by default, "Root" is the directory where the FTP files reside, and "Status" is set to "STOPPED" as directed.Connecting to server ...Done.

Server = SVR16

Site Name = Drivers

Metabase Path = MSFTPSVC/1932955329

IP = 172.31.69.150

Port = 21

Root = C:\Public\Download

Status = STOPPED

Example 3

The following example creates the "ChangePages" FTP site configuration on a remote server using Active Directory isolation. It associates the site with files stored in the C:\Public\Update directory on SVR16. The command uses the /dontstart parameter to prevent the site from starting automatically. The command also uses the /isolation parameter with a value of AD to specify Active Directory isolation, and uses the ADdomain, ADadmin, and ADpass parameters to provide the name of the Active Directory domain, as well as the domain administrator name and password.The /s parameter specifies the server name, and the /u and /p parameters specify the user account and password for the administrator of the remote server, under whose permissions the iisftp.vbs script runs.

iisftp /create C:\Public\Update ChangePages /dontstart /isolation AD /ADdomain DomainA /ADadmin Admin5 /ADpass p@ssWor# /s SVR16 /u Admin6 /p p@SSwor#

In response, iisftp displays the following message along with the basic properties of the new FTP site. In this example, "Server" represents the server machine; "Site Name" is the name assigned to the FTP site, in this example, ChangePages; "Metabase Path" represents the metabase key assigned by IIS and is analogous to a registry key in the system registry; "IP" is unassigned by default; "Port" is set to 21 by default; "Root" is the directory where the FTP files reside; "IsoMode" is the isolation mode, which is Active Directory; and "Status" is set to STOPPED as specified in the command.

Connecting to server....Done.

Server = SVR16

Site Name = ChangePages

Metabase Path = MSFTPSCV/945765436

IP = ALL UNASSIGNED

Port = 21

Root = C:\Public\Update

IsoMode = AD

Status = STOPPED