Skip to content

Commit c8df5a2

Browse files
authored
Update replication-error-8418.md - Enhancing SD Size limit dialog
1 parent 6dcd56b commit c8df5a2

File tree

1 file changed

+110
-2
lines changed

1 file changed

+110
-2
lines changed

support/windows-server/active-directory/replication-error-8418.md

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ Other Blocking Issues
145145
|Disabled Replication<br/><br/>|[2028495](https://support.microsoft.com/help/2028495)<br/><br/>|Status 8457|
146146
|DNS (Name Resolution)|[2021446](https://support.microsoft.com/help/2021446)|Event ID 2023 with Status code 8524|
147147
|RPC|1722:<br/><br/> [2102154](https://support.microsoft.com/help/2102154) <br/><br/>1753:<br/><br/>[2089874](https://support.microsoft.com/help/2089874)|Status Code 1722<br/><br/>Status Code 1753|
148+
|nTSecurityDescriptor Size ||Event ID 1450 with Error value 1340 The inherited access control list (ACL) or access control entry (ACE) could not be built. <br/><br/>This problem occurs because the Security Descriptor on the problem object has exceeded the maximum size of 65,535 bytes. This is an operating system limitation.|
148149

149150
## Resolution
150151

@@ -153,6 +154,7 @@ In order to resolve an issue where schema mismatch is cited, it is critical to u
153154
- Recent Schema Update
154155
- DC Promotion
155156
- Normal Replication
157+
- nTSecurityDescriptor Size
156158

157159
As stated previously, in the case of a recent schema update it is common for some DC's to report the schema mismatch as a normal part of processing the update. This state should only be investigated if it persists for an extended period Schema Mismatch during promotion of a DC is almost always a persistent issue that cannot be overcome without investigation and remedial steps being taken.
158160

@@ -299,6 +301,114 @@ Look for correlating events including the ones noted above which point to known
299301

300302
Look for events that might indicate other underlying issues on the source or destination that might be blocking replication and so causing what might be a transient mismatch failure to persist.
301303

304+
Security Descriptor Size
305+
306+
If the Size of the nTSecurityDescriptor is greater than 64KB, it can also generate this error. You must manually check from the object reported in Event ID 1450 to see where ACEs have been applied from. Below is sample code that you can use as en example of what you can write specifically for your organization.
307+
308+
```console
309+
#This sample script is not supported under any Microsoft standard support
310+
#program or service. This sample script is provided AS IS without warranty of
311+
#any kind. Microsoft further disclaims all implied warranties including,
312+
#without limitation, any implied warranties of merchantability or of fitness
313+
#for a particular purpose. The entire risk arising out of the use or
314+
#performance of the sample scripts and documentation remains with you. In no
315+
#event shall Microsoft, its authors, or anyone else involved in the creation,
316+
#production, or delivery of the scripts be liable for any damages whatsoever
317+
#(including, without limitation, damages for loss of business profits, business
318+
#interruption, loss of business information, or other pecuniary loss) arising
319+
#out of the use of or inability to use this sample script or documentation,
320+
#even if Microsoft has been advised of the possibility of such damages.
321+
322+
<#
323+
324+
.SYNOPSIS
325+
Calculates the size (in bytes) of the ntSecurityDescriptor on AD objects under a given base DN,
326+
and writes results to a CSV file.
327+
328+
.PARAMETER Base
329+
The LDAP base DN or container to search (e.g., "OU=Users,DC=contoso,DC=com")
330+
331+
.PARAMETER OutputPath
332+
Path to the CSV file where results will be written.
333+
334+
.PARAMETER MinimumSize
335+
Optional. Only include objects whose ntSecurityDescriptor size is greater than this threshold (in bytes).
336+
337+
.EXAMPLE
338+
.\Get-ACLByteSize.ps1 -Base "OU=Users,DC=contoso,DC=com" -OutputPath "C:\Temp\NTSD_Sizes.csv"
339+
340+
.EXAMPLE
341+
.\Get-ACLByteSize.ps1 -Base "DC=contoso,DC=com" -OutputPath "C:\Temp\NTSD_Sizes.csv" -MinimumSize 60000
342+
#>
343+
344+
param(
345+
[Parameter(Mandatory = $true)]
346+
[string]$Base,
347+
348+
[Parameter(Mandatory = $true)]
349+
[string]$OutputPath,
350+
351+
[Parameter(Mandatory = $false)]
352+
[int]$MinimumSize = 0
353+
)
354+
355+
Import-Module ActiveDirectory -ErrorAction Stop
356+
357+
$results = @()
358+
359+
Write-Host "Enumerating AD objects under $Base ..."
360+
361+
$Objects = Get-ADObject -Filter * -SearchBase $Base -Properties distinguishedName
362+
363+
foreach ($object in $Objects) {
364+
try {
365+
# Bind and request SD
366+
$searcher = [adsisearcher]"(distinguishedName=$($object.DistinguishedName))"
367+
$searcher.PropertiesToLoad.Add("ntSecurityDescriptor") | Out-Null
368+
$searcher.SecurityMasks = "Dacl,Owner,Group,sacl"
369+
$result = $searcher.FindOne()
370+
371+
if ($null -ne $result -and $result.Properties["ntsecuritydescriptor"].Count -gt 0) {
372+
$sdBytes = $result.Properties["ntsecuritydescriptor"][0]
373+
374+
if ($sdBytes -is [byte[]]) {
375+
$size = $sdBytes.Length
376+
}
377+
elseif ($sdBytes -is [System.DirectoryServices.ActiveDirectorySecurity]) {
378+
$size = ($sdBytes.GetSecurityDescriptorBinaryForm()).Length
379+
}
380+
else {
381+
Write-Warning "Unexpected SD type on $($object.DistinguishedName): $($sdBytes.GetType().FullName)"
382+
continue
383+
}
384+
385+
if ($size -ge $MinimumSize) {
386+
$results += [pscustomobject]@{
387+
DistinguishedName = $object.DistinguishedName
388+
ObjectClass = $object.ObjectClass
389+
NTSD_Size_Bytes = $size
390+
}
391+
}
392+
}
393+
else {
394+
Write-Verbose "No ntSecurityDescriptor found for $($object.DistinguishedName)"
395+
}
396+
}
397+
catch {
398+
Write-Warning "Error processing $($object.DistinguishedName): $_"
399+
}
400+
}
401+
402+
if ($results.Count -gt 0) {
403+
$results | Sort-Object NTSD_Size_Bytes -Descending | Export-Csv -Path $OutputPath -NoTypeInformation -Encoding UTF8
404+
Write-Host "`nExported $($results.Count) results to $OutputPath"
405+
}
406+
else {
407+
Write-Warning "No results matched your criteria (MinimumSize=$MinimumSize)."
408+
}
409+
410+
````
411+
302412
Examples of other causes include but are not limited to:
303413

304414
- Database Corruption
@@ -311,8 +421,6 @@ Examples of other causes include but are not limited to:
311421

312422
- Disabled Replication
313423

314-
- Objects with Security Descriptors in excess of 64 Kb
315-
316424
- DNS (Name Resolution) etc.
317425

318426
- RPC Communication Failures

0 commit comments

Comments
 (0)