Applied to: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1
You can use command-line scripting iisftp.vbs (stored in systemroot\system32) to create a file Transfer Protocol (FTP) site configuration on a local or remote computer running a member of the Windows Server 2003 family with IIS 6.0. The command does not create or destroy content, but it sets the directory structure and IIS configuration files.
Iisftp.vbs Download: http://www.jb51.net/jiaoben/193101.html
When you use Iisftp.vbs to create a new FTP site, you specify only the basic attributes required to create a site and identify its content. The default properties used by Iisftp.vbs are the same as those used by IIS Manager when establishing a new FTP site, and it follows the same inheritance property rules. To configure more advanced properties for an FTP site, use IIS Manager.
Important matters
Only members of the Administrators group on the local computer can run scripts and executables. As a security best practice, log on to the computer using an account that is not part of the Administrators group, and then use the runas command to run scripts and executables as an administrator. At the command prompt, type runas/profile/user:mycomputer\administrator cmd, open a command window with administrator privileges, and then type Cscript.exescriptname (including the full path and any parameters of the script).
This topic includes the following information:
• Syntax: The order in which you type the command and any parameters and options that follow it.
• Parameter: Gives the value of the variable in the command.
• Example: Sample code and a description of the result.
Grammar
Iisftp/create path SiteName iisftp/create path sitename[/b Port] [/I ipaddress] [/dontstart] [/isolation {ad| local} [/addomain domainname/adadmin [Domain\]user/adpass Password]] [s/s Computer [/u [domain\]user/p Password]]
Parameters
Path
Specifies the location of the FTP site content file. The path must be a local path, such as C:\Projects\HTML. If the specified path does not exist, Iisftp.vbs creates the path.
In the command, the Path parameter must be immediately preceding the SiteName parameter. Otherwise, Iisftp.vbs does not correctly interpret site information.
SiteName
Required. Specifies the name of the FTP site.
/b Port
Specifies the TCP port number for the FTP site. Port 21 is the default value.
/I IPAddress
Specifies the IP address of the FTP site. The default value is "All Unassigned", which specifies to the site all IP addresses on the computer that are not assigned to other sites. Only one site can be set to "All Unassigned" on each IIS server.
/dontstart
Indicates that the FTP site should not be started automatically immediately after it is created, as opposed to the IIS default setting.
/isolation {ad| Local}
Provides one of two types of user isolation modes: AD (Active Directory) and Local. If the/isolation switch does not exist, the site does not use user isolation.
/addomain DomainName
Valid only if the/isolation switch is set to AD. The value is the name of the Active Directory domain.
/adadmin [Domain\]user
Valid only if the/isolation switch is set to AD. The value is the administrator name in the format user, Domain\User, or user@domain.
/adpass Password
Valid only if the/isolation switch is set to AD. The value is the administrator's password.
/s Computer
Runs the script on the specified remote computer. Type the name or IP address of the computer without the backslash. The default is the local computer.
/u [domain\]user
Runs the script with the permissions of the specified user account. The 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 for the user account specified in the/u parameter.
Note
Iisftp.vbs does not verify the port number or the IP address of the FTP site, and it does not verify that the bindings are unique within the server. If you create a site with an invalid or conflicting binding, the site will not start.
Sample
Example 1
The following example creates a "Archive" FTP site on the local computer and associates it with the contents of the D:\Public\Archives directory. This command ignores all optional parameters and accepts the default values. The "Archives" subdirectory does not exist, so iisftp.vbs will create the subdirectory in the "public" directory.
Copy Code code as follows:
Iisftp/create D:\Public\Archives Archive
In response, IIsFtp displays the following message and the basic properties of the new FTP site. In this example, "Server" represents drive D: The computer name in which the site name is specified for the FTP site, and the metabase path represents the configuration database entry specified by IIS, which is similar to the registry key in the system registry, and "IP" is unassigned by default, "Port" By default, set to 21, root is the directory where the FTP file resides, and state 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 a "Drivers" FTP site site configuration on a remote server. It associates the site with the files stored in the C:\Public\Download directory on SVR16. This command uses the/I parameter to specify the IP address of the site and uses the/dontstart parameter to prevent the site from starting automatically. It uses the/s parameter to specify the remote computer, using the/U and/P parameters to run the script with the user's administrator account permissions.
Copy Code code as follows:
Iisftp/create C:\Public\Download drivers/i 172.31.69.150/dontstart/s svr16/u admin6/p
In response, IIsFtp displays the following message and the basic properties of the new FTP site. In this example, "Server" represents the server computer, "the site name is the name specified for the FTP site, and the metabase path represents the configuration database entry specified by IIS, which is similar to the registry key in the system registry, and" IP "indicates the specified DNS address, and port is set to 21 by default. Root is the directory where the FTP file resides, and the status is set to stopped as needed.
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 a "Changepages" FTP site configuration using Active Directory isolation on a remote server. It associates the site with the files stored in the C:\Public\Update directory on SVR16. This command uses the/dontstart parameter to prevent the site from starting automatically. The command can also specify Active Directory isolation using the/isolation parameter and the value of the AD, and then use the ADDomain, adadmin, and Adpass parameters to provide the name of the Active Directory domain and the domain administrator name and password 。 The/s parameter specifies the server name, the/U and/P parameters specify the administrator's user account and password for the remote server, and the Iisftp.vbs script runs with its permissions.
Copy Code code as follows:
Iisftp/create C:\Public\Update changepages/dontstart/isolation ad/addomain domaina/adadmin admin5/adpass/s svr16/u admin6/p p@sswor#
In response, IIsFtp displays the following message and the basic properties of the new FTP site. In this example, "Server" represents the server computer, "site name" is the name specified for the FTP site, in this example, Changepages "Metabase Path" represents the metabase entry specified by IIS, which is similar to the registry key in the system registry, and "IP" is unassigned by default , Port is set to 21 by default, and "root" is the directory where the FTP file resides, "IsoMode" is in isolation mode, and the mode is active Directory, and status is set to started according to the command description.
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