Script that will automate the process of creating FTP Server with user isolation(Domain users)

This script will setup microsoft windows ftp server with ftp user isolation for Domain users.
(Note: If you do not know What the FTP with user isolation is, you can check my full article here )

What this script will do:
1) Prompt for FTP server role and IIS management console installation if not already installed.
2) Create ftp group (default is "ftp_group") to give ftp permission to ftp site in the specified OU.
3) All domain users in the specified OU will be added to the newly created group in the same OU.
4) Create new FTP site, set SSL Mode, set user isolation mode, create virtual directory, enable basic authentication  and create authorization rule.

Note: All domain users who will access this ftp site need to be created first in the specified  OU.
Example usage:                      
.\Setup_FTP_User_Isolation_AD.ps1 -OU "Sale Dept" -FtpRootDir D:\FtpRoot -FtpGroup "sale users"
-FtpSiteName ftp.contoso.com -Port 21 -RequireSSL -ExcludeUsers "Sales Admin","Jenny"
Author: phyoepaing3.142@gmail.com
Country: Myanmar(Burma)
Released: 09/09/2016
EXAMPLE
.\Setup_FTP_User_Isolation_AD.ps1
It will prompt for OU and FTP Site Name and setup with default parameters. See Get-Help .\Setup_FTP_User_Isolation_AD.ps1 -PARAMETER <parameter> for each parameter usage.
EXAMPLE
.\Setup_FTP_User_Isolation_AD.ps1 -OU "Sale Dept" -FtpRootDir D:\FtpRoot -FtpGroup "sale users" -FtpSiteName ftp.contoso.com -Port 21 -RequireSSL -ExcludeUsers "Sale Admin","Jenny"
It will create group "sale users" and add all users (except "Sale Admin" and "Jenny") to that group.
Then, it will create ftp site "ftp.contoso.com" with service port "21".

Note: If you include "RequireSSL", you need a valid certificate to use in your ftp site.
PARAMETER OU
Specify the Organizational Unit in which ftp users' group will be created. All users in this OU (Except users in -ExcludeUsers parameter) will be added to that group.
PARAMETER FtpRootDir
Specify the root directory in which user's ftp home folders are created. Default is c:\ftproot.
PARAMETER FtpGroup
Specify the group name for ftp users. Default is "ftp_group".
PARAMETER FtpSiteName
Specify the name of the ftp site.
PARAMETER Port
Specify the network port of your ftp site.
PARAMETER RequireSSL
If used, this parameter will set the FTP SSL Mode to "SSL Require". All users connection will be encrypted.
You need a valid SSL certificate (public certificate, self-signed certificate or from Microsoft CA) to use this.
PARAMETER ExcludeUsers
Specify the users you want to exclude in specified OU(defined in -OU parameter) to be added to group. Also, these users will not have ftp folders and permissions to access ftp site.

Fig-1: The Powershell Runtime

FTP with User Isolation has been setup

PowerShell
Edit|Remove
Script that will automate the process of creating FTP Server with user isolation(Domain users) 
 
DESCRIPTION 
This script will setup microsoft windows ftp server with ftp user isolation for Domain users. 
What this script will do: 
1) Prompt for FTP server role and IIS management console installation if not already installed. 
2) Create ftp group (default is "ftp_group") to give ftp permission to ftp site in the specified OU. 
3) All domain users in the specified OU will be added to the newly created group in the same OU. 
4) Create new FTP site, set SSL Mode, set user isolation mode, create virtual directory, enable basic authentication  and create authorization rule. 
Note: All domain users who will access this ftp site need to be created first in the specified  OU. 
 
Example usage:                                                                                       
.\Setup_FTP_User_Isolation_AD.ps1 -OU "Sale Dept" -FtpRootDir D:\FtpRoot -FtpGroup "sale users" 
-FtpSiteName ftp.contoso.com -Port 21 -RequireSSL -ExcludeUsers "Sales Admin","Jenny" 
 
Author: phyoepaing3.142@gmail.com 
Country: Myanmar(Burma) 
Released: 09/09/2016 
 
EXAMPLE 
.\Setup_FTP_User_Isolation_AD.ps1 
It will prompt for OU and FTP Site Name and setup with default parameters. See Get-Help .\Setup_FTP_User_Isolation_AD.ps1 -PARAMETER <parameter> for each parameter usage. 
 
EXAMPLE 
.\Setup_FTP_User_Isolation_AD.ps1 -OU "Sale Dept" -FtpRootDir D:\FtpRoot -FtpGroup "sale users" -FtpSiteName ftp.contoso.com -Port 21 -RequireSSL -ExcludeUsers "Sale Admin","Jenny" 
 
It will create group "sale users" and add all users (except "Sale Admin" and "Jenny") to that group. 
Then, it will create ftp site "ftp.contoso.com" with service port "21". 
Note: If you include "RequireSSL", you need a valid certificate to use in your ftp site. 
 
PARAMETER OU 
Specify the Organizational Unit in which ftp users' group will be created. All users in this OU (Except users in 
-ExcludeUsers parameter) will be added to that group. 
 
PARAMETER FtpRootDir 
Specify the root directory in which user's ftp home folders are created. Default is c:\ftproot. 
 
PARAMETER FtpGroup 
Specify the group name for ftp users. Default is "ftp_group". 
 
PARAMETER FtpSiteName 
Specify the name of the ftp site. 
 
PARAMETER Port 
Specify the network port of your ftp site. 
 
PARAMETER RequireSSL 
If used, this parameter will set the FTP SSL Mode to "SSL Require". All users connection will be encrypted. 
You need a valid SSL certificate (public certificate, self-signed certificate or from Microsoft CA) to use this. 
 
PARAMETER ExcludeUsers 
Specify the users you want to exclude in specified OU(defined in -OU parameter) to be added to group. Also, these users will not have ftp folders and permissions to access ftp site. 
 
LINK 
You can find this script and more at: https://www.sysadminplus.blogspot.com/ 
#>