NTFS权限

时间:2019-04-18 23:03:12

标签: powershell ntfs

我想将用户添加到NTFS权限,并完全控制特定的文件夹。

这是我在互联网上找到的代码,但它给了我一个错误。

Set-ACL -Path "C:\Program Files (x86)\TEST" -Account "DESKTOP-R5C0QAA\Bobby" -AccessRights FullControl
Set-Acl : A parameter cannot be found that matches parameter name 'Account'.
At line:1 char:45
Set-ACL -Path "C:\Program Files (x86)\TEST" -Account "DESKTOP-R5C0QAA ...
CategoryInfo          : InvalidArgument: (:) [Set-Acl], ParameterBindingException
FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetAclCommand

1 个答案:

答案 0 :(得分:0)

这是我能找到的最简单的方法。

Install-Module NTFSSecurity
Add-NTFSAccess –Path "C:\Program Files (x86)\TEST" –Account "DESKTOP-R5C0QAA\Bobby" –AccessRights FullControl

More info here on NTFS Security module