PowerShell - Get-ACL未返回所有权限

时间:2016-02-09 12:04:10

标签: powershell acl


我尝试使用Get-ACL cmdlet读取各种文件夹的权限 它工作正常,我可以看到Get-ACL $path | %{$_.Access}的授权用户。但我注意到缺少一些权限 如果我进入任何文件夹properties > Security (Tab) > Advanced,我都能看到相应的权限及其适用的内容 某些权限设置为适用于nothing,而Get-ACL未显示这些权限。

这引出了我的问题:
有没有办法读出acl的Applies to字段?
我尝试使用.NET函数[System.IO.Directory]::GetAccessControl(),但它没有提供此信息。

非常感谢任何帮助或提示!

修改

为了澄清这个问题,我拍了一些截图:

这表示设置为“无”的权限 这似乎是一个错误,因为我无法为任何其他权限条目选择“无”。

Permission that applies to nothing

这是通过Powershell返回的acl(缺少“OWNER RIGHTS”):

The "nothing" permission does not show

1 个答案:

答案 0 :(得分:0)

适用于“没有”不是AFAIK的有效值,所以我们需要证明。

“适用于”字段是InheritanceFlagsPropagationFlags的组合,两者中的值“无”等于仅适用于此文件夹。这些将显示Get-ACL

PS C:\Users\frode> (Get-Acl .\Desktop\test).Access

#Applies to: Subfolder and files only
FileSystemRights  : ReadAndExecute, Synchronize
AccessControlType : Allow
IdentityReference : frode-pc\frode
IsInherited       : False
InheritanceFlags  : ContainerInherit, ObjectInherit
PropagationFlags  : InheritOnly

#Applies to: This folder only
FileSystemRights  : ReadAndExecute, Synchronize
AccessControlType : Allow
IdentityReference : frode-pc\frodetest
IsInherited       : False
InheritanceFlags  : None
相关问题