原始 KB 数: 4533837
总结
本文讨论 Active Directory 复制错误 8304(0x2070):“对象的最大大小已超出”。
注意
可以通过运行 net helpmsg 8304
命令获取错误代码的友好文本。
现象
可能会遇到以下症状之一。
症状 1
该 dcdiag
命令报告 Active Directory 复制测试失败并生成了错误 8304:“已超出对象的最大大小。
Starting test: Replications
[Replications Check, <DESTINATION DC>] A recent replication attempt failed:
From <SOURCE DC>to <DESTINATION DC>
Naming Context: <directory partition DN path>
The replication generated an error (8304):
The maximum size of an object has been exceeded.
The failure occurred at <date><time>.
The last success occurred at <date><time>.
......................... <DESTINATION DC> failed test Replications
症状 2
右键单击源域控制器(DC)的连接对象,然后选择“ 立即复制”时,复制失败并生成以下错误消息:
立即复制
尝试将命名上下文 <Active Directory 分区名称>从域控制器<源 DC 同步到域控制器<目标 DC>> 期间发生以下错误:
已超出对象的最大大小
操作不会继续
症状 3
各种repadmin.exe命令失败并生成错误 8304。 这些命令包括但不限于以下内容:
repadmin /add
repadmin /replsum
repadmin /showrepl
repadmin /showrepl
repadmin /syncall
症状 4
事件 ID 1084 记录在尝试复制 Active Directory 对象的 DC 的目录服务事件日志中。
Log Name: Directory Service
Source: Microsoft-Windows-ActiveDirectory_DomainService
Event ID: 1084
Task Category: Replication
Level: Error
User: ANONYMOUS LOGON
Computer: <Destination DC>
Description:
Internal event: Active Directory Domain Services could not update the following object with changes received from the following source directory service. This is because an error occurred during the application of the changes to Active Directory Domain Services on the directory service.
Object:
CN=john\0ADEL:<GUID>,CN=Deleted Objects,<directory partition DN path>
Object GUID:
<GUID>
Source directory service:
<GUID>._msdcs.contoso.com
Synchronization of the directory service with the source directory service is blocked until this update problem is corrected.
This operation will be tried again at the next scheduled replication.
User Action
Restart the local computer if this condition appears to be related to low system resources (for example, low physical or virtual memory).
Additional Data
Error value:
8304 The maximum size of an object has been exceeded.
还可以看到事件 1093:
Log Name: Directory Service
Source: Microsoft-Windows-ActiveDirectory_DomainService
Event ID: 1093
Task Category: Replication
Level: Warning
Computer: <Destination DC>
Description:
Active Directory Domain Services could not update the following object with attribute changes because the incoming change caused the object to exceed the maximum object record size. The incoming change to the following attribute will be reversed in an attempt to complete the update.
Object:
CN=<MachineName>\0ADEL:<GUID>,CN=Deleted
Objects,DC=xxxx,DC=domainname,DC=com
Object GUID:
<GUID>
Attribute:
9030d (lastKnownParent)
The current value (without changes) of the attribute on the local directory partition will replicate to all other directory services. This will counteract the change to the rest of the directory services. The reversal values may be recognized as follows:
Version:
2
Time of change:
<DateTime>
Update sequence number:
65064475
Note this event may not quote the attribute that has the most data or values. It quotes the update for the attribute that made the object size overflow.
原因
当域控制器尝试复制超过最大大小的对象时,将记录错误 8304。
最常见的原因是具有具有大量值的非链接属性。 由于 Active Directory 数据库的内部结构以及 Active Directory 数据库记录大小为 8 KB,此值限制约为 1200-1300 值,具体取决于其他非链接属性的填充。
注意
在所有域控制器都在运行 Windows Server 2025(预览版)或更高版本的林中,林和域功能级别都设置为 Windows Server 2025(预览版)或更高版本 ,并且启用了数据库 32k 页面可选功能,多值属性现在可以保留大约 3,200 个值。 因此,遇到问题的机会会显著减少。
有关详细信息,请参阅:
重要
Windows Server 2025 处于预览版阶段。 此信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 Microsoft 不对此处提供的信息作任何明示或默示的担保。
在源服务器上,使用 LDP 之类的工具或在 repadmin /showattr /allvalues /extended
对象上运行命令时,输出如下所示:
1> distinguishedName:<GUID=<GUID>>;CN=Allowedclients\0ADEL:<GUID>,CN=Deleted Objects,CN=Configuration,DC=contoso,DC=com
1> instanceType: 0x4 = ( WRITE )
1> whenCreated: 25.4.2018. 13:48:07Central European Daylight Time
…
1> msDS-LastKnownRDN: Allowed clients
1>msExchSmtpReceiveMaxRecipientsPerMessage: 200
1243> msExchSmtpReceiveRemoteIPRanges:10.142.241.142;…
以下是可能会遇到问题的属性:
- proxyAddresses
- servicePrincipalName
- userCertificate
- msExchSmtpReceiveRemoteIPRanges
- dnsRecord
- msiFileList
- msTSProperty01、msTSProperty02、 ...
- registeredAddress
注意
对于任何多值非链接属性,可能会出现此问题。 具有链接语法或与数据链接的属性不受此问题的影响。
根据可用的资源和实际的本地数据库页面填充,限制可能会达到不同的值数。 这就是为什么某些域控制器或 LDS 实例可以执行某些更改,但不能对其他实例进行更改。
当单个属性值超过大约 5 MB 时,也可能出现此问题。 更新属性值时,AD 数据库事务必须同时保存上一个值和新值。
解决方法
此限制独立于 Microsoft LDAP 服务器 OS 版本。 没有针对此限制的解决方法。 可能需要修改应用程序及其使用此属性的方式。
1084 事件将列出超过最大大小的对象。 如果对象是活动对象,请标识具有过多值的属性,并删除源域控制器上的某些值。
如果对象是已删除的对象,并且启用了 Active Directory 回收站,则更正问题的最佳方法是强制对象成为已回收对象。 回收对象时,Active Directory 会删除大多数属性。 这通常会减小对象的大小,以便可以成功复制它。 此过程将真正删除该对象,并使它无法从回收站恢复。 如果对象是安全主体(例如用户帐户),建议不要取消删除该对象。 如果未删除足够大的对象,它可能会阻止正确设置某些属性。 这可能导致对象损坏,并可能阻止对象被使用,甚至被删除。
以下 PowerShell 命令可用于强制对象进入回收状态。
注意
以下命令必须作为源域控制器在 1084 事件中列出的 DC 上运行。 该事件还将列出对象可分辨名称。
Get-ADObject <dn of object> -IncludeDeletedObjects | Remove-ADObject
例如:
Get-ADObject "CN=john\0ADEL:<GUID>,CN=Deleted Objects,dc=contoso,dc=com" | Remove-ADObject
回收对象后,使用 Active Directory 站点和服务尝试强制复制。
详细信息
下面是一些建议,以避免过去Microsoft问题的限制。
Microsoft DNS 服务器使用 dnsRecord 属性
每个 IP 地址或 SRV 名称目标都是 dnsRecord 属性的附加值。 默认情况下,Active Directory 中的每个域控制器都会向 DNS 注册一系列名称,有些基于域控制器涵盖的站点,有些是无站点的。 对于无站点名称,通常会达到此限制。
在域中处理大量域控制器(如 1200 个域控制器)时,可能会有问题更新名称的 DNS 对象以及附加值。 在此类域中,通常也不需要为无站点名称提供这么多条目。 若要避免此限制,可以在不应出现在无站点名称的域控制器上创建注册表值“DnsAvoidRegisterRecords”。
版本 1 命名空间属性 PKT 中的 DFS 卷管理
DFS 版本 1 命名空间为每个命名空间使用单个 AD 对象,并且所有 DFS 链接信息都保存在单个属性“PKT”中。 当此 Blob 超过 5 MB(大约 5000 个链接)时,管理命名空间时出现问题。
有关详细信息,请参阅 DFS 的工作原理。
在 Windows Server 2008 中,DFS 引入了版本 2 命名空间,其中每个 DFS 链接都是单独的 AD 对象。
数据收集
如果需要Microsoft支持方面的帮助,建议按照使用 TSS 收集 Active Directory 复制问题的信息中所述的步骤收集信息。