Created
May 12, 2017 13:16
-
-
Save robsonalves/3833e43c1657e5120a824c215941b52a to your computer and use it in GitHub Desktop.
Config FTP windows server via PS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-module servermanager | |
Add-WindowsFeature web-server –includeallsubfeature | |
Import-Module WebAdministration | |
New-WebFtpSite -Name "LinxFTP" -Port "21" -Force | |
cmd /c \Windows\System32\inetsrv\appcmd set SITE "LinxFTP" "-virtualDirectoryDefaults.physicalPath:C:\inetpub\ftproot" | |
Set-ItemProperty "IIS:\Sites\LinxFTP" -Name ftpServer.security.ssl.controlChannelPolicy -Value 0 | |
Set-ItemProperty "IIS:\Sites\LinxFTP" -Name ftpServer.security.ssl.dataChannelPolicy -Value 0 | |
Set-ItemProperty "IIS:\Sites\LinxFTP" -Name ftpServer.security.authentication.basicAuthentication.enabled -Value $true | |
Set-ItemProperty "IIS:\Sites\LinxFTP" -Name ftpserver.userisolation.mode -Value 3 | |
Add-WebConfiguration "/system.ftpServer/security/authorization" -value @{accessType="Allow";roles="";permissions="Read,Write";users="*"} -PSPath IIS:\ -location "LinxFTP" | |
New-NetFirewallRule -DisplayName "FTP In" -Direction Inbound -Protocol TCP –Enabled True –Action Allow -Profile Any -Program "%SystemRoot%\System32\ftp.exe" -Service Any -LocalPort 20,21,1024-65535 -EdgeTraversalPolicy Allow | |
Restart-WebItem "IIS:\Sites\LinxFTP" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment