如何在powershell中设置IIS7.5 FTP站点的授权?
我正在尝试使用powershell 2.0设置IIS7 FTP站点的授权 授权应该是允许Joe读、写。 之前,我使用appcmd完成了以下操作:如何在powershell中设置IIS7.5 FTP站点的授权?,powershell,ftp,powershell-2.0,Powershell,Ftp,Powershell 2.0,我正在尝试使用powershell 2.0设置IIS7 FTP站点的授权 授权应该是允许Joe读、写。 之前,我使用appcmd完成了以下操作: %windir%\system32\inetsrv\appcmd set config MyFTPSite -section:system.ftpServer/security/authorization /+"[accessType='Allow',users='Joe',permissions='Read, Write']" /commit:app
%windir%\system32\inetsrv\appcmd set config MyFTPSite -section:system.ftpServer/security/authorization /+"[accessType='Allow',users='Joe',permissions='Read, Write']" /commit:apphost
Set-WebConfiguration "/system.ftpServer/security/authorization" -Location MyFTPSite -value @{accessType='Allow';users='Joe';roles='';permissions='Read, Write'}
我认为应该使用Set-WebConfiguration,但到目前为止,我还没有任何运气。事实证明它并没有那么糟糕。答案如下:
%windir%\system32\inetsrv\appcmd set config MyFTPSite -section:system.ftpServer/security/authorization /+"[accessType='Allow',users='Joe',permissions='Read, Write']" /commit:apphost
Set-WebConfiguration "/system.ftpServer/security/authorization" -Location MyFTPSite -value @{accessType='Allow';users='Joe';roles='';permissions='Read, Write'}