Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

set "FTP Authorization Rules" on virtualdirectory

$
0
0

I am trying to automate the creation of user ftp directories on IIS7 (w2008R2).
The desired stucture is like:
-ftp root (Allow “ftp users” Read)
-usera (virtual folder,Allow “usera” Read,Write)
-userb (virtual folder,Allow “userb” Read,Write)
-userc (virtual folder,Allow “userc” Read,Write)
I am almost there, except the setting of authorization is not working. Just the user needs to have read,write rights in its own ftp directory, not every “ftp user” read.
In the GUI, I have to remove the inhereted right from “ftp root” (Allow “ftp users” Read), and add Allow Rule for the user with Read,Write. How can I script this ?
I thought something like this:
add-webconfiguration "/system.ftpServer/security/authorization" -value (@{accessType="Allow";users="usera";permissions="Read,Write"}) -PSPath "IIS:\sites\ftp root" -location usera
But it complains about some filename……????
Add-WebConfiguration : Filename:
Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent leve
l. Locking is either by default (overrideModeDefault=”Deny”), or set explicitly by a location tag with overrideMode=”De
ny” or the legacy allowOverride=”false”.

I read somewhere that I cannot use set-webconfiguration.
How can I set the correct right on the virtual ftp directory ?


Viewing all articles
Browse latest Browse all 13067