Legen Sie Berechtigungen und Einstellungen auf dem IIS-FTP-site mithilfe von PowerShell

Ich bin Anfänger in PowerShell versuche ich, dieses script und funktionierte gut, aber ich brauche zum ändern der FTP-Autorisierungsregeln "Alle Benutzer" (Lesen,Schreiben) und ändern Sie die "FTP-benutzerisolation", "User Name Directory".

##    NEEDED FOR IIS CMDLETS
Import-Module WebAdministration

##    CREATE FTP SITE AND SET C:\inetpub\ftproot AS HOME DIRECTORY
New-WebFtpSite -Name "Default FTP Site" -Port "21" -Force
cmd /c \Windows\System32\inetsrv\appcmd set SITE "Default FTP Site" "-virtualDirectoryDefaults.physicalPath:C:\inetpub\ftproot"

##    SET PERMISSIONS

## Allow SSL connections 
Set-ItemProperty "IIS:\Sites\Default FTP Site" -Name ftpServer.security.ssl.controlChannelPolicy -Value 0
Set-ItemProperty "IIS:\Sites\Default FTP Site" -Name ftpServer.security.ssl.dataChannelPolicy -Value 0

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

## Give Authorization to Administrators and grant "read"/"write" privileges
Add-WebConfiguration "/system.ftpServer/security/authorization" -value @{accessType="Allow";roles="Administrators";permissions=3} -PSPath IIS:\ -location "Default FTP Site"

## Restart the FTP site for all changes to take effect
Restart-WebItem "IIS:\Sites\Default FTP Site"
InformationsquelleAutor kIrODO | 2014-05-07
Schreibe einen Kommentar