FTP-Standardfeatures <customFeatures>
Übersicht
Das <customFeatures>
-Element wird verwendet, um die Sammlung von FTP-Anbietern anzugeben, die benutzerdefinierte Funktionen für FTP-Site implementieren.
Hinweis
Die Anbieter, die dieser Auflistung hinzugefügt werden, können benutzerdefinierte Protokollierungs- oder Basisverzeichnis-Suchvorgänge implementieren. Benutzerdefinierte FTP-Anbieter, die Authentifizierungs- und Rollen-Lookups implementieren, werden der Auflistung <ftpServer/security/authentication/customAuthentication>
hinzugefügt.
Hinweis
Die benutzerdefinierten Features, die dem <customFeatures/providers>
-Element hinzugefügt werden, müssen in der <system.ftpServer/providerDefinitions>
-Auflistung registriert werden.
Hinweis
Unterstützung für das Erstellen von Anbietern benutzerdefinierter Features wurde in FTP 7.5 eingeführt. Weitere Informationen zum Erstellen benutzerdefinierter FTP-Feature-Anbieter finden Sie im Thema Entwickeln für FTP 7.5 auf der IIS.net-Website von Microsoft.
Kompatibilität
Version | Hinweise |
---|---|
IIS 10.0 | Das <customFeatures> -Element wurde in IIS 10.0 nicht geändert. |
IIS 8.5 | Das <customFeatures> -Element wurde in IIS 8.5 nicht geändert. |
IIS 8.0 | Das <customFeatures> -Element wurde in IIS 8.0 nicht geändert. |
IIS 7.5 | Das <customFeatures> -Element des <ftpServer> -Elements wird als Feature von IIS 7.5 bereitgestellt. |
IIS 7.0 | Das Element <customFeatures> des Elements <ftpServer> wurde in FTP 7.0 als separater Download für IIS 7.0 eingeführt. |
IIS 6.0 | Der FTP-Dienst in IIS 6.0 hat die Erweiterbarkeit nicht unterstützt. |
Hinweis
Die Dienste FTP 7.0 und FTP 7.5 waren nicht im Lieferumfang von IIS 7.0 enthalten, daher mussten die Module unter der folgenden URL heruntergeladen und installiert werden:
Bei Windows 7 und Windows Server 2008 R2 wird der FTP 7.5-Dienst als Feature für IIS 7.5 bereitgestellt, sodass das Herunterladen des FTP-Diensts nicht mehr erforderlich ist.
Setup
Um die FTP-Veröffentlichung für Ihren Webserver zu unterstützen, müssen Sie den FTP-Dienst installieren. Führen Sie dazu die folgenden Schritte aus:
Windows Server 2012 oder Windows Server 2012 R2
Klicken Sie auf der Taskleiste auf Server-Manager.
Klicken Sie im Server-Manager auf Verwalten und dann auf Rollen und Features hinzufügen.
Klicken Sie im Assistenten zum Hinzufügen von Rollen und Features auf Weiter. Wählen Sie den Installationstyp aus, und klicken Sie auf Weiter. Wählen Sie den Zielserver aus, und klicken Sie auf Weiter.
Erweitern Sie auf der Seite Serverrollen den Eintrag Webserver (IIS), und wählen Sie dann FTP-Server aus.
Klicken Sie auf Weiter, und wählen Sie dann auf der Seite Features auswählen erneut Weiter aus.
Klicken Sie auf der Seite Installationsauswahl bestätigen auf Installieren.
Klicken Sie auf der Seite Ergebnisse auf Schließen.
Windows 8 oder Windows 8.1
Bewegen Sie auf dem Startbildschirm den Mauszeiger ganz nach links unten, klicken Sie mit der rechten Maustaste auf die Schaltfläche Start und klicken Sie dann auf Systemsteuerung.
Klicken Sie in der Systemsteuerung auf Programme und Features, und klicken Sie dann auf Windows-Features aktivieren oder deaktivieren.
Erweitern Sie Internetinformationsdienste, und wählen Sie dann FTP-Server aus.
Klicken Sie auf OK.
Klicken Sie auf Schließen.
Windows Server 2008 R2
Klicken Sie auf der Taskleiste auf Start, zeigen Sie auf Verwaltungstools, und klicken Sie dann auf Server-Manager.
Erweitern Sie im Hierarchiebereich des Server-Managers die Rollenund klicken Sie dann auf den Webserver (IIS) .
Scrollen Sie im Bereich Webserver (IIS) zum Abschnitt Rollendienste, und klicken Sie dann auf Rollendienste hinzufügen.
Erweitern Sie auf der Seite Rollendienste auswählen des Assistenten zum Hinzufügen von Rollendiensten die Option FTP-Server.
Wählen Sie FTP-Dienst aus.
Klicken Sie auf Weiter.
Klicken Sie auf der Seite Installationsauswahl bestätigen auf Installieren.
Klicken Sie auf der Seite Ergebnisse auf Schließen.
Windows 7
Klicken Sie auf der Taskleiste auf Start und dann auf Systemsteuerung.
Klicken Sie in der Systemsteuerung auf Programme und dann auf Windows-Features aktivieren oder deaktivieren.
Erweitern Sie Internetinformationsdienste und dann FTP-Server.
Wählen Sie FTP-Dienst aus.
Klicken Sie auf OK.
Windows Server 2008 oder Windows Vista
Laden Sie das Installationspaket unter der folgenden URL herunter:
Befolgen Sie die Anweisungen in der folgenden exemplarischen Vorgehensweise, um den FTP-Dienst zu installieren:
Gewusst wie
Zurzeit gibt es keine Benutzeroberfläche, über die Sie einer Website benutzerdefinierte Features hinzufügen können. Weitere Informationen zum Hinzufügen von benutzerdefinierten Features zu einer FTP-Site finden Sie in den Abschnitten Konfiguration und Beispielcode dieses Dokuments.
Konfiguration
Attribute
Keine.
Hinweis
Ein nicht verwendetes Attribut namens <impersonationLevel>
wurde im FTP 7.0-Schema deklariert, dies wurde jedoch aus dem FTP 7.5-Schema entfernt und sollte nicht verwendet werden.
Untergeordnete Elemente
Element | Beschreibung |
---|---|
providers |
Optionales Element. Gibt die Standardauflistung von benutzerdefinierten FTP-Features an. |
Konfigurationsbeispiel
Das folgende Konfigurationsbeispiel zeigt ein <siteDefaults>
-Beispielelement für einen Server, das mehrere der Standardeinstellungen für eine FTP-Site definiert.
<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>
Beispielcode
Die folgenden Codebeispiele veranschaulichen das Festlegen mehrerer Standardeinstellungen für eine FTP-Site.
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
Hinweis
Sie müssen den commit-Parameter auf apphost
festlegen, wenn Sie „AppCmd.exe“ verwenden, um diese Einstellungen zu konfigurieren. Dadurch werden die Konfigurationseinstellungen auf den entsprechenden Speicherortabschnitt in der Datei ApplicationHost.config festgelegt.
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()