【发布时间】:2020-01-22 16:48:29
【问题描述】:
尝试在 PowerShell 中做一些相当简单的事情。在默认 ftp 站点上禁用匿名 FTP 并启用基本身份验证,如下所示:FTP Authentication。
这是我正在尝试的:
c:\windows\system32\inetsrv\appcmd unlock config /section:anonymousAuthentication
c:\windows\system32\inetsrv\appcmd unlock config /section:basicAuthentication
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/anonymousAuthentication -name Enabled -value false -PSPath 'IIS:\sites\Default FTP Site\'
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/basicAuthentication -name Enabled -value true -PSPath 'IIS:\sites\Default FTP Site\'
这成功了:
Unlocked section "system.webServer/security/authentication/anonymousAuthentication" at configuration path "MACHINE/WEBROOT/APPHOST".
Unlocked section "system.webServer/security/authentication/basicAuthentication" at configuration path "MACHINE/WEBROOT/APPHOST".
但它对实际的 IIS 配置完全没有影响。我错过了什么?
【问题讨论】:
标签: powershell iis ftp