預設 FTP Active Directory 使用者隔離設定 < activeDirectory>
概觀
元素 <activeDirectory>
會指定認證和連線逾時,以便與 Active Directory 伺服器通訊以進行 FTP 使用者隔離。 此選項與在 IIS 6.0 FTP 伺服器中選擇 Active Directory 使用者隔離相同,其中使用者帳戶必須在其 Active Directory 物件中設定msIIS-FTPRoot 和 msIIS-FTPDir屬性。
- 如果 FTP 服務成功存取 msIIS-FTPRoot 和 msIIS-FTPDir 屬性所指定的路徑,它會成為使用者的主目錄,而且使用者無法存取此目錄外的檔案系統。 - 如果 FTP 服務無法存取msIIS-FTPRoot 和 msIIS-FTPDir屬性所指定的路徑,或msIIS-FTPRoot或msIIS-FTPDir屬性不存在,則會拒絕使用者存取。
For additional information about how to configure the Active Director properties, see the "Isolate Users Using Active Directory Mode" section in the Hosting Multiple FTP Sites with FTP User Isolation (IIS 6.0) topic.
相容性
版本 | 備註 |
---|---|
IIS 10.0 | 未在 IIS 10.0 中修改專案 <activeDirectory> 。 |
IIS 8.5 | 未在 IIS 8.5 中修改專案 <activeDirectory> 。 |
IIS 8.0 | 未在 IIS 8.0 中修改專案 <activeDirectory> 。 |
IIS 7.5 | 元素 <activeDirectory> 的 <userIsolation> 元素隨附為 IIS 7.5 的功能。 |
IIS 7.0 | 元素 <activeDirectory> 的 <userIsolation> 元素是在 FTP 7.0 中引進,這是 IIS 7.0 的個別下載專案。 |
IIS 6.0 | N/A |
使用 Windows 7 和 Windows Server 2008 R2 時,FTP 7.5 服務隨附為 IIS 7.5 的功能,因此不再需要下載 FTP 服務。
安裝程式
若要支援 Web 服務器的 FTP 發佈,您必須安裝 FTP 服務。 若要這樣做,請使用下列步驟。
Windows Server 2012 或 Windows Server 2012 R2
在工作列上,按一下 [伺服器管理員]。
在[伺服器管理員] 中,按一下 [管理] 功能表,然後按一下 [新增角色及功能]。
在 [ 新增角色及功能精 靈] 中,按 [ 下一步]。 選取安裝類型,然後按 [ 下一步]。 選取目的地伺服器,然後按 [ 下一步]。
在 [ 伺服器角色] 頁面上,展開 [ Web 服務器 (IIS) ],然後選取 [ FTP 伺服器]。
按 [下一步],然後在 [ 選取功能 ] 頁面上,再次按 [ 下一步 ]。
在 [確認安裝選項] 頁面上,按一下 [安裝]。
在 [結果] 頁面上,按一下 [關閉]。
Windows 8 或 Windows 8.1
在 [開始] 畫面上,將指標一路移至左下角,以滑鼠右鍵按一下 [開始] 按鈕,然後按一下[主控台]。
在主控台中,按一下 [程式和功能],然後按一下 [開啟或關閉 Windows 功能]。
展開 [Internet Information Services],然後選取 [ FTP 伺服器]。
按一下 [確定]。
按一下 [關閉] 。
Windows Server 2008 R2
在工作列上,按一下 [開始],指向 [系統管理工具],然後按一下[伺服器管理員]。
在[伺服器管理員階層] 窗格中,展開 [角色],然後按一下 [Web 服務器] (IIS) 。
在 [ Web Server (IIS) ] 窗格中,捲動至 [ 角色服務 ] 區段,然後按一下 [ 新增角色服務]。
在 [新增角色服務精靈] 的 [選取角色服務] 頁面上,展開[FTP 伺服器]。
選取 [FTP 服務]。
按一下 [下一步] 。
在 [確認安裝選項] 頁面上,按一下 [安裝]。
在 [結果] 頁面上,按一下 [關閉]。
Windows 7
在工作列上,按一下 [開始],然後按一下[主控台]。
在主控台中,按一下 [程式和功能],然後按一下[開啟或關閉 Windows 功能]。
展開 [Internet Information Services],然後展開 [ FTP 伺服器]。
選取 [FTP 服務]。
按一下 [確定]。
Windows Server 2008 或 Windows Vista
從下列 URL 下載安裝套件:
請遵循下列逐步解說中的指示來安裝 FTP 服務:
作法
如何使用 Active Directory 隔離使用者
開啟 [Internet Information Services (IIS) 管理員:
如果您使用 Windows Server 2012 或 Windows Server 2012 R2:
- 在工作列上,依序按一下 [伺服器管理員]、[工具],然後按一下 [Internet Information Services (IIS) Manager]。
如果您使用 Windows 8 或 Windows 8.1:
- 按住Windows鍵,按字母X,然後按一下[主控台]。
- 按一下 [系統管理工具],然後按兩下 [ Internet Information Services (IIS) Manager]。
如果您使用 Windows Server 2008 或 Windows Server 2008 R2:
- 在工作列上,按一下 [ 開始],指向 [ 系統管理工具],然後按一下 [ Internet Information Services (IIS) 管理員]。
如果您使用 Windows Vista 或 Windows 7:
- 在工作列上,按一下 [開始],然後按一下[主控台]。
- 按兩下 [系統管理工具],然後按兩下 [ Internet Information Services] (IIS) Manager。
在 [ 連線] 窗格中,展開伺服器名稱、展開 [ 站 台] 節點,然後按一下網站的名稱。
在 [ FTP 使用者隔離 ] 頁面的 [隔離使用者] 底下。將使用者限制為下列目錄:,選取 Active Directory 中設定的 FTP 主目錄 ,然後按一下 [ 設定]。
在 [ 設定認證 ] 對話方塊中,于 [ 使用者名稱 ] 和 [密碼] 方塊中輸入使用者名稱和 密碼 。 在 [ 確認密碼 ] 方塊中再次輸入密碼,然後按一下 [ 確定]。
在 [動作] 窗格中,按一下 [套用]。
For additional information about how to set up the Active Directory, see the "Isolate Users Using Active Directory Mode" section in the Hosting Multiple FTP Sites with FTP User Isolation (IIS 6.0) topic.
組態
元素 <activeDirectory>
是在月臺層級設定。
屬性
屬性 | 描述 |
---|---|
adCacheRefresh |
選擇性的 timeSpan 屬性。 指定快取 Active Directory 資訊的時間範圍。 預設值是 00:01:00 。 |
adPassword |
選擇性的加密字串屬性。 指定與 Active Directory 伺服器連線的使用者密碼。 沒有任何預設值。 |
adUserName |
選擇性字串屬性。 指定與 Active Directory 伺服器連線的使用者名稱。 沒有任何預設值。 |
子元素
無。
組態範例
下列組態範例會顯示定義數個 FTP 月臺預設值之伺服器的範例 <siteDefaults>
元素。
<siteDefaults>
<logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />
<traceFailedRequestsLogging enabled="true" directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />
<ftpServer serverAutoStart="true">
<connections controlChannelTimeout="300" />
<security>
<commandFiltering>
<add command="SYST" allowed="false" />
</commandFiltering>
<ssl serverCertHash="57686f6120447564652c2049495320526f636b73" controlChannelPolicy="SslAllow" dataChannelPolicy="SslAllow" />
<sslClientCertificates clientCertificatePolicy="CertIgnore" />
<authentication>
<anonymousAuthentication enabled="false" />
<basicAuthentication enabled="false" />
<clientCertAuthentication enabled="false" />
<customAuthentication>
<providers>
<add name="FtpCustomAuthenticationModule" enabled="false" />
</providers>
</customAuthentication>
</authentication>
</security>
<messages bannerMessage="Welcome!" allowLocalDetailedErrors="true" />
<fileHandling keepPartialUploads="false" />
<firewallSupport externalIp4Address="169.254.10.10" />
<userIsolation mode="None" />
<directoryBrowse showFlags="StyleUnix, DisplayAvailableBytes" />
<logFile period="Daily" enabled="true" />
</ftpServer>
</siteDefaults>
範例程式碼
下列程式碼範例說明如何設定數個 FTP 月臺預設值。
AppCmd.exe
REM Configure FTP sites to start automatically by default.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.serverAutoStart:"True" /commit:apphost
REM Configure the default control channel time-out for 300 seconds.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.connections.controlChannelTimeout:"300" /commit:apphost
REM Configure the default FTP security options.
appcmd.exe set config -section:system.applicationHost/sites /+"siteDefaults.ftpServer.security.commandFiltering.[command='SYST',allowed='False']" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.ssl.controlChannelPolicy:"SslAllow" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.ssl.dataChannelPolicy:"SslAllow" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.ssl.serverCertHash:"57686f6120447564652c2049495320526f636b73" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.authentication.anonymousAuthentication.enabled:"False" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.authentication.basicAuthentication.enabled:"False" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.authentication.clientCertAuthentication.enabled:"False" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.sslClientCertificates.clientCertificatePolicy:"CertIgnore" /commit:apphost
appcmd.exe set config -section:system.applicationHost/sites /+"siteDefaults.ftpServer.security.authentication.customAuthentication.providers.[name='FtpCustomAuthenticationModule',enabled='False']" /commit:apphost
REM Configure a custom default banner message and local detailed error messages.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.messages.bannerMessage:"Welcome!" /siteDefaults.ftpServer.messages.allowLocalDetailedErrors:"True" /commit:apphost
REM Configure the FTP service to keep partially-uploaded files by default.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.fileHandling.keepPartialUploads:"False" /commit:apphost
REM Configure the default external IP address of a firewall.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.firewallSupport.externalIp4Address:"169.254.10.10" /commit:apphost
REM Specify no user isolation by default.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.userIsolation.mode:"None" /commit:apphost
REM Configure UNIX-style directory listings by default and display the available drive space.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.directoryBrowse.showFlags:"StyleUnix, DisplayAvailableBytes" /commit:apphost
REM Enable logging by default with daily log file rollover.
appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.logFile.period:"Daily" /siteDefaults.ftpServer.logFile.enabled:"True" /commit:apphost
注意
當您使用 AppCmd.exe 來設定這些設定時,請務必將 認可 參數 apphost
設定為 。 這會將組態設定認可至ApplicationHost.config檔案中的適當位置區段。
C#
using System;
using System.Text;
using Microsoft.Web.Administration;
internal static class Sample
{
private static void Main()
{
using (ServerManager serverManager = new ServerManager())
{
Configuration config = serverManager.GetApplicationHostConfiguration();
ConfigurationSection sitesSection = config.GetSection("system.applicationHost/sites");
ConfigurationElement siteDefaultsElement = sitesSection.GetChildElement("siteDefaults");
ConfigurationElement ftpServerElement = siteDefaultsElement.GetChildElement("ftpServer");
// Configure FTP sites to start automatically by default.
ftpServerElement["serverAutoStart"] = true;
// Configure the default control channel time-out for 300 seconds.
ConfigurationElement connectionsElement = ftpServerElement.GetChildElement("connections");
connectionsElement["controlChannelTimeout"] = 300;
// Configure the default FTP security options.
ConfigurationElement securityElement = ftpServerElement.GetChildElement("security");
ConfigurationElement commandFilteringElement = securityElement.GetChildElement("commandFiltering");
ConfigurationElementCollection commandFilteringCollection = commandFilteringElement.GetCollection();
ConfigurationElement addElement = commandFilteringCollection.CreateElement("add");
addElement["command"] = @"SYST";
addElement["allowed"] = false;
commandFilteringCollection.Add(addElement);
ConfigurationElement sslElement = securityElement.GetChildElement("ssl");
sslElement["controlChannelPolicy"] = @"SslAllow";
sslElement["dataChannelPolicy"] = @"SslAllow";
sslElement["serverCertHash"] = "57686f6120447564652c2049495320526f636b73";
ConfigurationElement authenticationElement = securityElement.GetChildElement("authentication");
ConfigurationElement anonymousAuthenticationElement = authenticationElement.GetChildElement("anonymousAuthentication");
anonymousAuthenticationElement["enabled"] = false;
ConfigurationElement basicAuthenticationElement = authenticationElement.GetChildElement("basicAuthentication");
basicAuthenticationElement["enabled"] = false;
ConfigurationElement clientCertAuthenticationElement = authenticationElement.GetChildElement("clientCertAuthentication");
clientCertAuthenticationElement["enabled"] = false;
ConfigurationElement sslClientCertificatesElement = securityElement.GetChildElement("sslClientCertificates");
sslClientCertificatesElement["clientCertificatePolicy"] = @"CertIgnore";
ConfigurationElement customAuthenticationElement = authenticationElement.GetChildElement("customAuthentication");
ConfigurationElementCollection providersCollection = customAuthenticationElement.GetCollection("providers");
ConfigurationElement addElement1 = providersCollection.CreateElement("add");
addElement1["name"] = @"FtpCustomAuthenticationModule";
addElement1["enabled"] = false;
providersCollection.Add(addElement1);
// Configure a custom default banner message and local detailed error messages.
ConfigurationElement messagesElement = ftpServerElement.GetChildElement("messages");
messagesElement["bannerMessage"] = @"Welcome!";
messagesElement["allowLocalDetailedErrors"] = true;
// Configure the FTP service to keep partially-uploaded files by default.
ConfigurationElement fileHandlingElement = ftpServerElement.GetChildElement("fileHandling");
fileHandlingElement["keepPartialUploads"] = false;
// Configure the default external IP address of a firewall.
ConfigurationElement firewallSupportElement = ftpServerElement.GetChildElement("firewallSupport");
firewallSupportElement["externalIp4Address"] = @"169.254.10.10";
// Specify no user isolation by default.
ConfigurationElement userIsolationElement = ftpServerElement.GetChildElement("userIsolation");
userIsolationElement["mode"] = @"None";
// Configure UNIX-style directory listings by default and display the available drive space.
ConfigurationElement directoryBrowseElement = ftpServerElement.GetChildElement("directoryBrowse");
directoryBrowseElement["showFlags"] = @"StyleUnix, DisplayAvailableBytes";
// Enable logging by default with daily log file rollover.
ConfigurationElement logFileElement = ftpServerElement.GetChildElement("logFile");
logFileElement["period"] = @"Daily";
logFileElement["enabled"] = true;
serverManager.CommitChanges();
}
}
}
VB.NET
Imports System
Imports System.Text
Imports Microsoft.Web.Administration
Module Sample
Sub Main()
Dim serverManager As ServerManager = New ServerManager
Dim config As Configuration = serverManager.GetApplicationHostConfiguration
Dim sitesSection As ConfigurationSection = config.GetSection("system.applicationHost/sites")
Dim siteDefaultsElement As ConfigurationElement = sitesSection.GetChildElement("siteDefaults")
Dim ftpServerElement As ConfigurationElement = siteDefaultsElement.GetChildElement("ftpServer")
' Configure FTP sites to start automatically by default.
ftpServerElement("serverAutoStart") = True
' Configure the default control channel time-out for 300 seconds.
Dim connectionsElement As ConfigurationElement = ftpServerElement.GetChildElement("connections")
connectionsElement("controlChannelTimeout") = 300
' Configure the default FTP security options.
Dim securityElement As ConfigurationElement = ftpServerElement.GetChildElement("security")
Dim commandFilteringElement As ConfigurationElement = securityElement.GetChildElement("commandFiltering")
Dim commandFilteringCollection As ConfigurationElementCollection = commandFilteringElement.GetCollection
Dim addElement As ConfigurationElement = commandFilteringCollection.CreateElement("add")
addElement("command") = "SYST"
addElement("allowed") = False
commandFilteringCollection.Add(addElement)
Dim sslElement As ConfigurationElement = securityElement.GetChildElement("ssl")
sslElement("controlChannelPolicy") = "SslAllow"
sslElement("dataChannelPolicy") = "SslAllow"
sslElement("serverCertHash") = "57686f6120447564652c2049495320526f636b73"
Dim authenticationElement As ConfigurationElement = securityElement.GetChildElement("authentication")
Dim anonymousAuthenticationElement As ConfigurationElement = authenticationElement.GetChildElement("anonymousAuthentication")
anonymousAuthenticationElement("enabled") = False
Dim basicAuthenticationElement As ConfigurationElement = authenticationElement.GetChildElement("basicAuthentication")
basicAuthenticationElement("enabled") = False
Dim clientCertAuthenticationElement As ConfigurationElement = authenticationElement.GetChildElement("clientCertAuthentication")
clientCertAuthenticationElement("enabled") = False
Dim sslClientCertificatesElement As ConfigurationElement = securityElement.GetChildElement("sslClientCertificates")
sslClientCertificatesElement("clientCertificatePolicy") = "CertIgnore"
Dim customAuthenticationElement As ConfigurationElement = authenticationElement.GetChildElement("customAuthentication")
Dim providersCollection As ConfigurationElementCollection = customAuthenticationElement.GetCollection("providers")
Dim addElement1 As ConfigurationElement = providersCollection.CreateElement("add")
addElement1("name") = "FtpCustomAuthenticationModule"
addElement1("enabled") = False
providersCollection.Add(addElement1)
' Configure a custom default banner message and local detailed error messages.
Dim messagesElement As ConfigurationElement = ftpServerElement.GetChildElement("messages")
messagesElement("bannerMessage") = "Welcome!"
messagesElement("allowLocalDetailedErrors") = True
' Configure the FTP service to keep partially-uploaded files by default.
Dim fileHandlingElement As ConfigurationElement = ftpServerElement.GetChildElement("fileHandling")
fileHandlingElement("keepPartialUploads") = False
' Configure the default external IP address of a firewall.
Dim firewallSupportElement As ConfigurationElement = ftpServerElement.GetChildElement("firewallSupport")
firewallSupportElement("externalIp4Address") = "169.254.10.10"
' Specify no user isolation by default.
Dim userIsolationElement As ConfigurationElement = ftpServerElement.GetChildElement("userIsolation")
userIsolationElement("mode") = "None"
' Configure UNIX-style directory listings by default and display the available drive space.
Dim directoryBrowseElement As ConfigurationElement = ftpServerElement.GetChildElement("directoryBrowse")
directoryBrowseElement("showFlags") = "StyleUnix, DisplayAvailableBytes"
' Enable logging by default with daily log file rollover.
Dim logFileElement As ConfigurationElement = ftpServerElement.GetChildElement("logFile")
logFileElement("period") = "Daily"
logFileElement("enabled") = True
serverManager.CommitChanges()
End Sub
End Module
JavaScript
var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";
var sitesSection = adminManager.GetAdminSection("system.applicationHost/sites", "MACHINE/WEBROOT/APPHOST");
var siteDefaultsElement = sitesSection.ChildElements.Item("siteDefaults");
var ftpServerElement = siteDefaultsElement.ChildElements.Item("ftpServer");
// Configure FTP sites to start automatically by default.
ftpServerElement.Properties.Item("serverAutoStart").Value = true;
// Configure the default control channel time-out for 300 seconds.
var connectionsElement = ftpServerElement.ChildElements.Item("connections");
connectionsElement.Properties.Item("controlChannelTimeout").Value = 300;
// Configure the default FTP security options.
var securityElement = ftpServerElement.ChildElements.Item("security");
var commandFilteringElement = securityElement.ChildElements.Item("commandFiltering");
var commandFilteringCollection = commandFilteringElement.Collection;
var addElement = commandFilteringCollection.CreateNewElement("add");
addElement.Properties.Item("command").Value = "SYST";
addElement.Properties.Item("allowed").Value = false;
commandFilteringCollection.AddElement(addElement);
var sslElement = securityElement.ChildElements.Item("ssl");
sslElement.Properties.Item("controlChannelPolicy").Value = "SslAllow";
sslElement.Properties.Item("dataChannelPolicy").Value = "SslAllow";
sslElement.Properties.Item("serverCertHash").Value = "57686f6120447564652c2049495320526f636b73";
var authenticationElement = securityElement.ChildElements.Item("authentication");
var anonymousAuthenticationElement = authenticationElement.ChildElements.Item("anonymousAuthentication");
anonymousAuthenticationElement.Properties.Item("enabled").Value = false;
var basicAuthenticationElement = authenticationElement.ChildElements.Item("basicAuthentication");
basicAuthenticationElement.Properties.Item("enabled").Value = false;
var clientCertAuthenticationElement = authenticationElement.ChildElements.Item("clientCertAuthentication");
clientCertAuthenticationElement.Properties.Item("enabled").Value = false;
var sslClientCertificatesElement = securityElement.ChildElements.Item("sslClientCertificates");
sslClientCertificatesElement.Properties.Item("clientCertificatePolicy").Value = "CertIgnore";
var customAuthenticationElement = authenticationElement.ChildElements.Item("customAuthentication");
var providersCollection = customAuthenticationElement.ChildElements.Item("providers").Collection;
var addElement1 = providersCollection.CreateNewElement("add");
addElement1.Properties.Item("name").Value = "FtpCustomAuthenticationModule";
addElement1.Properties.Item("enabled").Value = false;
providersCollection.AddElement(addElement1);
// Configure a custom default banner message and local detailed error messages.
var messagesElement = ftpServerElement.ChildElements.Item("messages");
messagesElement.Properties.Item("bannerMessage").Value = "Welcome!";
messagesElement.Properties.Item("allowLocalDetailedErrors").Value = true;
// Configure the FTP service to keep partially-uploaded files by default.
var fileHandlingElement = ftpServerElement.ChildElements.Item("fileHandling");
fileHandlingElement.Properties.Item("keepPartialUploads").Value = false;
// Configure the default external IP address of a firewall.
var firewallSupportElement = ftpServerElement.ChildElements.Item("firewallSupport");
firewallSupportElement.Properties.Item("externalIp4Address").Value = "169.254.10.10";
// Specify no user isolation by default.
var userIsolationElement = ftpServerElement.ChildElements.Item("userIsolation");
userIsolationElement.Properties.Item("mode").Value = "None";
// Configure UNIX-style directory listings by default and display the available drive space.
var directoryBrowseElement = ftpServerElement.ChildElements.Item("directoryBrowse");
directoryBrowseElement.Properties.Item("showFlags").Value = "StyleUnix, DisplayAvailableBytes";
// Enable logging by default with daily log file rollover.
var logFileElement = ftpServerElement.ChildElements.Item("logFile");
logFileElement.Properties.Item("period").Value = "Daily";
logFileElement.Properties.Item("enabled").Value = true;
adminManager.CommitChanges();
VBScript
Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"
Set sitesSection = adminManager.GetAdminSection("system.applicationHost/sites", "MACHINE/WEBROOT/APPHOST")
Set siteDefaultsElement = sitesSection.ChildElements.Item("siteDefaults")
Set ftpServerElement = siteDefaultsElement.ChildElements.Item("ftpServer")
' Configure FTP sites to start automatically by default.
ftpServerElement.Properties.Item("serverAutoStart").Value = True
' Configure the default control channel time-out for 300 seconds.
Set connectionsElement = ftpServerElement.ChildElements.Item("connections")
connectionsElement.Properties.Item("controlChannelTimeout").Value = 300
' Configure the default FTP security options.
Set securityElement = ftpServerElement.ChildElements.Item("security")
Set commandFilteringElement = securityElement.ChildElements.Item("commandFiltering")
Set commandFilteringCollection = commandFilteringElement.Collection
Set addElement = commandFilteringCollection.CreateNewElement("add")
addElement.Properties.Item("command").Value = "SYST"
addElement.Properties.Item("allowed").Value = False
commandFilteringCollection.AddElement(addElement)
Set sslElement = securityElement.ChildElements.Item("ssl")
sslElement.Properties.Item("controlChannelPolicy").Value = "SslAllow"
sslElement.Properties.Item("dataChannelPolicy").Value = "SslAllow"
sslElement.Properties.Item("serverCertHash").Value = "57686f6120447564652c2049495320526f636b73"
Set authenticationElement = securityElement.ChildElements.Item("authentication")
Set anonymousAuthenticationElement = authenticationElement.ChildElements.Item("anonymousAuthentication")
anonymousAuthenticationElement.Properties.Item("enabled").Value = False
Set basicAuthenticationElement = authenticationElement.ChildElements.Item("basicAuthentication")
basicAuthenticationElement.Properties.Item("enabled").Value = False
Set clientCertAuthenticationElement = authenticationElement.ChildElements.Item("clientCertAuthentication")
clientCertAuthenticationElement.Properties.Item("enabled").Value = False
Set sslClientCertificatesElement = securityElement.ChildElements.Item("sslClientCertificates")
sslClientCertificatesElement.Properties.Item("clientCertificatePolicy").Value = "CertIgnore"
Set customAuthenticationElement = authenticationElement.ChildElements.Item("customAuthentication")
Set providersCollection = customAuthenticationElement.ChildElements.Item("providers").Collection
Set addElement1 = providersCollection.CreateNewElement("add")
addElement1.Properties.Item("name").Value = "FtpCustomAuthenticationModule"
addElement1.Properties.Item("enabled").Value = False
providersCollection.AddElement(addElement1)
' Configure a custom default banner message and local detailed error messages.
Set messagesElement = ftpServerElement.ChildElements.Item("messages")
messagesElement.Properties.Item("bannerMessage").Value = "Welcome!"
messagesElement.Properties.Item("allowLocalDetailedErrors").Value = True
' Configure the FTP service to keep partially-uploaded files by default.
Set fileHandlingElement = ftpServerElement.ChildElements.Item("fileHandling")
fileHandlingElement.Properties.Item("keepPartialUploads").Value = False
' Configure the default external IP address of a firewall.
Set firewallSupportElement = ftpServerElement.ChildElements.Item("firewallSupport")
firewallSupportElement.Properties.Item("externalIp4Address").Value = "169.254.10.10"
' Specify no user isolation by default.
Set userIsolationElement = ftpServerElement.ChildElements.Item("userIsolation")
userIsolationElement.Properties.Item("mode").Value = "None"
' Configure UNIX-style directory listings by default and display the available drive space.
Set directoryBrowseElement = ftpServerElement.ChildElements.Item("directoryBrowse")
directoryBrowseElement.Properties.Item("showFlags").Value = "StyleUnix, DisplayAvailableBytes"
' Enable logging by default with daily log file rollover.
Set logFileElement = ftpServerElement.ChildElements.Item("logFile")
logFileElement.Properties.Item("period").Value = "Daily"
logFileElement.Properties.Item("enabled").Value = True
adminManager.CommitChanges()