简体   繁体   English

如何在Powershell中设置IIS7.5 FTP站点的授权?

[英]How do I set the authorization of an IIS7.5 FTP site in powershell?

I'm trying to set the authorization of an IIS7 FTP site using powershell 2.0. 我正在尝试使用Powershell 2.0设置IIS7 FTP站点的授权。

The authorization should be Allow Joe Read,Write. 授权应为“允许Joe读,写”。 Previously I've done this with appcmd as follows: 以前,我使用appcmd做到了这一点,如下所示:

%windir%\system32\inetsrv\appcmd set config MyFTPSite -section:system.ftpServer/security/authorization /+"[accessType='Allow',users='Joe',permissions='Read, Write']" /commit:apphost

I think it should be something using Set-WebConfiguration, but so far I haven't had any luck. 我认为应该使用Set-WebConfiguration,但是到目前为止我还没有碰到任何运气。

事实证明答案还不错,如下所示:

Set-WebConfiguration "/system.ftpServer/security/authorization" -Location MyFTPSite -value @{accessType='Allow';users='Joe';roles='';permissions='Read, Write'} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM