Method to change the port range in IIS FTP PASV mode

  • 2020-05-06 12:01:11
  • OfStack

If this property is specified, FTP validates from 5001 to 65535. To limit the size of this oversize port, use the IIS management utility Adsutil.vbs.
cd c:\Inetpub\AdminScripts
Es7en.vbs set /MSFTPSVC/PassivePortRange "89900-8909" (example: open 10 specified ports)
Restart FTP service
Note: if the firewall is turned on, you must also add the above port.

Attachment: Adsutil.vbs common syntax
Configure
for directory access C:\Inetpub\Admins cripts > chaccess.vbs -a w3svc/1/ROOT -verbose
Usage: chaccess < --ADSPath|-a ADSPATH > Control configuration path
[--computer |-c COMPUTER1[,COMPUTER2...]] specify the machine name, IP is also available.
[+read |-read] home directory read permissions
[+write |-write] write permission
in the home directory [+s cript |-s cript] the execute permissions under the home directory are pure script
[+****ute|-****ute] the execution permissions under the home directory are script and executable
[+browse |-browse] directory browsing permissions
under the home directory [--verbose |-v] current version
[--help|-?]
Displays the properties and status information for the specified path
C:\Inetpub\Admins cripts > dispnode help
Usage: dispnode < --ADSPath|-a ADS PATH OF NODE > [--help|-h]
ADS PATH - The Path of the node to be displayed
Example 1: dispnode - a IIS: / / LocalHost w3svc displays the current
IIS main attributes 2: Example dispnode - adspath IIS: / / MachineName/w3svc / 1
according to current state of the site information Find the named Web and display the node number, description, hostname, port, and IP address
C:\Inetpub\Admins cripts > findweb
Web Site Number = 1
Web Site Des cription = default Web site
Hostname =
Port = 80
IP Address =
C:\Inetpub\Admins cripts > findweb m7.net
Web Site Number = 2
Web Site Des cription = m7.net
Hostname = www.m7.net
Port = 80
IP Address = www.m7.net
Displays the specified site path management tree
C:\Inetpub\Admins cripts > disptree.vbs help
Usage: disptree [--ADSPath |-a ROOT NODE] specifies the path
to display the management tree [--NoRecurse|-n]
[--Help|-?]
Create WEB virtual site
C:\Inetpub\Admins cripts > mkw3site help
Unknown argument help
Usage: mkw3site < --RootDirectory|-r ROOT DIRECTORY > Website pathname
< --Comment|-t SERVER COMMENT > The WEB website identifies
[--computer|-c COMPUTER1[,COMPUTER2...]]
[--port |-o PORT NUM] port
[--IPAddress |-i IP ADDRESS]IP address
[--HostName |-h HOST NAME] host name
[--SiteNumber|-n SITENUMBER]
[--DontStart] does not start
[--verbose|-v]
[--help|-?]
Creates a virtual directory
for the specified site C:\Inetpub\Admins cripts > mkwebdir.vbs help
Usage: mkwebdir [--computer |-c COMPUTER1,COMPUTER2] specifies the server name
< --website|-w WEBSITE1 > Specify the virtual site name
< --virtualdir|-v NAME1,PATH1,NAME2,PATH2,... > Specify the virtual directory name and directory file address
[--help|-?]
Example : mkwebdir -c MyComputer -w "Default Web Site"
-v "dir1","c:\inetpub\wwwroot\dir1","dir2","c:\inetpub\wwwroot\dir2"
Suspend IIS service
for a specified site C:\Inetpub\Admins cripts > pausesrv help
Usage: pausesrv < --ADSPath|-a server1[,server2,server3...] >
[--computer|-c COMPUTER1[,COMPUTER2...]]
[--verbose|-v]
[--help|-?]
Example 1: pausesrv -a w3svc/1,msftpsvc/2
Example 2: pauseftp -c MACHINE1,MACHINE2,MACHINE3 -a w3svc/1,msftpsvc/2
Restore the suspended site to IIS service
C:\Inetpub\Admins cripts > contsrv.vbs help
Usage: contsrv < --ADSPath|-a server1[,server2,server3...] >
[--computer|-c COMPUTER1[,COMPUTER2...]]
[--verbose|-v]
[--help|-?]
Example 1: contsrv -a w3svc/1,msftpsvc/2
Example 2: contsrv -c MACHINE1,MACHINE2,MACHINE3 -a w3svc/1,msftpsvc/2
Use
as above pauseftp.vbs suspends
server service FTP contftp.vbs resumes the suspended FTP service
pauseweb.vbs suspends Web server service
contweb.vbs resumes suspended WWW service
Stop IIS server service
for the specified site C:\Inetpub\Admins cripts > stopsrv.vbs -a w3svc/2
Start the IIS server service
for the specified site C:\Inetpub\Admins cripts > startsrv.vbs -a w3svc/2
Stop WEB server service
for the specified site C:\Inetpub\Admins cripts > startweb.vbs -a w3svc/2
Start the Web server service
for the specified site C:\Inetpub\Admins cripts > stopweb.vbs -a 2
The usage is the same as above
stopftp. vbs discontinues FTP server service
startftp.vbs starts FTP server service
Trace the execution of the script
C:\Inetpub\Admins cripts > synciwam.vbs -h
Usage: cs cript synciwam.vbs [-v|-h]
-v verbose: trace ****ution of the s cript
-h help: print this message

Related articles: