Основываясь на этой статье te chnet, он суммирует:
- Для туза, который не связан с расширенными правами, ObjectType ссылается на schemaIDGuid в разделе схемы.
- Для туза, связанного с расширенными правами, ObjectType ссылается на GUID RightsG в разделе конфигурации.
С учетом следующего кода:
$rootDSE = Get-ADRootDSE -ErrorAction Stop
# For an ace that is not associated with extended rights, the ObjectType refers to a schemaIDGuid in the schema partition.
$schema = Get-ADObject `
-SearchBase $rootDSE.schemaNamingContext `
-LDAPFilter '(schemaIDGUID=*)' `
-Properties * `
-ErrorAction Stop
$schemaMap = @{}
foreach ($obj in $schema)
{
$key = [guid]$obj.schemaIDGUID
$schemaMap[$key] = $obj
}
# For an ace that is associated with extended rights, the ObjectType refers to a rightsGUID in the configuration partition.
$configuration = Get-ADObject `
-SearchBase ('CN=Extended-Rights,{0}' -f $rootDSE.configurationNamingContext) `
-LDAPFilter '(objectClass=controlAccessRight)' `
-Properties * `
-ErrorAction Stop
$configurationMap = @{}
foreach ($obj in $configuration)
{
$key = [guid]$obj.rightsGUID
$configurationMap[$key] = $obj
}
$identity = 'AD:CN=my-group,OU=groups,OU=container,DC=example,DC=com'
$acl = Get-Acl -Path $identity -ErrorAction Stop
foreach ($ace in $acl.Access)
{
if ($ace.ObjectType -eq [guid]::Empty)
{
continue
}
$key = [guid]$ace.ObjectType
if ($ace.ActiveDirectoryRights.HasFlag([DirectoryServices.ActiveDirectoryRights]::ExtendedRight))
{
if (!$configurationMap.ContainsKey($key))
{
Write-Warning ('Right {0} for ObjectType {1} does not match a rightsGUID configuration partition, matches {2} in the schema partition.' -f $ace.ActiveDirectoryRights, $key, $schemaMap[$key].Name)
}
}
else
{
if (!$schemaMap.ContainsKey($key))
{
Write-Warning ('Right {0} for ObjectType {1} does not match a schemaIDGuid schema partition, matches {2} in the configuration partition.' -f $ace.ActiveDirectoryRights, $key, $configurationMap[$key].Name)
}
}
}
Результаты совсем не соответствуют статье, когда в поле ActiveDirectoryRights
включен адрес ExtendedRight
, он может иметь или не иметь указатель ObjectType
, найденный в разделе конфигурации, он может существовать в разделе схемы.
Я видел обходные пути, такие как this , который, как вы можете видеть из обработки ошибок, игнорирует коллизии, которые приводят к неправильным ассоциациям.
Какой правильный лог c необходим для вывода имени объекта, с которым связана данная запись контроля доступа?