事情就是这样,PowerShell ACL 只会向您展示该列表中的一些内容。以下是您可以做的事情来弄清楚这一点:
从您所拥有的情况来看,ActiveDirectoryRights 属性将告诉您给定规则正在影响哪些权利。让我们看看该属性的类型是什么,看看我们是否可以获得它认为是有效值的列表。我们可以在属性上运行.GetType() 方法来查看它是[ActiveDirectoryRights] 类型,但这还不足以得到我们想要的。我们需要全名,我们可以这样得到:
$acl.Audit[0].ActiveDirectoryRights.GetType()|Format-List
所以这里重要的是BaseType 和FullName 属性。 BaseType 是 System.Enum,FullName 是 System.DirectoryServices.ActiveDirectoryRights。从中我们可以使用[Enum] 基类型来获取与我们的类型关联的名称。
[enum]::GetNames([System.DirectoryServices.ActiveDirectoryRights])
我们得到了这个值列表:
CreateChild
DeleteChild
ListChildren
Self
ReadProperty
WriteProperty
DeleteTree
ListObject
ExtendedRight
Delete
ReadControl
GenericExecute
GenericWrite
GenericRead
WriteDacl
WriteOwner
GenericAll
Synchronize
AccessSystemSecurity
这些也可以通过here 找到。该网站还告诉您每一项的含义,以及诸如 GenericAll 之类的其他权利组合在一起的其他权利。
这是您将从 PowerShell 获得的信息,因此,如果这些信息足够了,那就太棒了,您已经得到了您正在寻找的信息。如果您希望获得列出的每种对象类型的所有细粒度权限,我认为您不会想要为此使用 PowerShell。是的,它们已列出,但您必须翻译对象类型 GUID。我所知道的唯一方法是查询所有具有 schemaIDGUID 的类的 AD,并且基本上从它们中构建一个哈希表,您可以稍后在查找所有这些访问时引用该哈希表。这一点你只需要做一次,然后在需要查找 GUID 时引用 $GUIDHT。
例如:
#Connect to ADDS and get a list of all objects with a schemaIDGUID
$root = Get-ADRootDSE
$schemaContext = $root.schemaNamingContext
$schemaObjects = Get-ADObject -SearchBase $schemaContext -Filter 'schemaIDGUID -like "*"' -Properties 'Name', 'schemaIDGUID', 'objectClass'
#Create hashtable with generic 'All' entry for all zero guids
$GUIDHT = @{[System.Guid]'00000000-0000-0000-0000-000000000000'=@{Name='All'}}
#Populate the hashtable with all of the GUIDs we found in AD
$schemaObjects|ForEach-Object{ $GUIDHT[$_.ObjectGUID]=$_ }
#Find the friendly name for a specific audit rule listing
$GUIDHT[$acl.Audit[0].ObjectType].Name
然后,对于 PropagationFlags 与 InheritanceFlags,事情开始变得混乱。 InheritanceFlags 决定什么样的对象可以继承规则。 PropagationFlags 确定规则是仅适用于对象、仅适用于对象的子项,还是两者都适用。