Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在powershell中设置IIS7.5 FTP站点的授权?_Powershell_Ftp_Powershell 2.0 - Fatal编程技术网

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

如何在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

我正在尝试使用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: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'}