-1

Is there a way to automate setting up FTP site in IIS on Windows Server? I can manually do that following this document. But I want to do it using a script.

I'm using IIS 10 on Azure VM running Windows Server 2016.

Hien Le
  • 301
  • 3
  • 14
  • Each steps can be automated by relevant PowerShell snippet. Use a search engine and you will find it. – Lex Li Nov 14 '19 at 03:52

1 Answers1

1

To Set up FTP external Firewall IP address and data channel port range, you could apply this script:

#Set up data channel
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.ftpServer/firewallSupport" -name "lowDataChannelPort" -value 5000
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.ftpServer/firewallSupport" -name "highDataChannelPort" -value 6000


#Set external firewall support
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/sites/siteDefaults/ftpServer/firewallSupport" -name "externalIp4Address" -value "1.1.1.1"

There are tons of link about how to build up FTP site with powershell. https://gallery.technet.microsoft.com/scriptcenter/Creating-FTP-in-IIS-and-014b8940

You could combine these scripts base on your requirement.

Jokies Ding
  • 3,374
  • 1
  • 5
  • 10