Powershell om FTP server in te richten

Onderstaande commando’s maken een FTP-site aan op een Windows Server. Hierbij wordt de gebruiker/wachtwoord in plain tekst geaccepteerd en de standaard folder is D:\Data\Ftp

Install-WindowsFeature Web-FTP-Server

Install-WindowsFeature Web-Mgmt-Console

Import-Module WebAdministration

New-WebFtpSite -Name "Default FTP Site" -Port "21" -Force

cmd /c \Windows\System32\inetsrv\appcmd set SITE "Default FTP Site" "-virtualDirectoryDefaults.physicalPath:D:\Data\Ftp" 

Set-ItemProperty "IIS:\Sites\Default FTP Site" -Name ftpServer.security.authentication.basicAuthentication.enabled -Value $true 

Add-WebConfiguration "/system.ftpServer/security/authorization" -value @{accessType="Allow";roles="Administrators";permissions=3} -PSPath IIS:\ -location "Default FTP Site"

Restart-WebItem "IIS:\Sites\Default FTP Site"