AK550654

Monitor_AK550654 (UnitMonitor)

Active Directory replication is failing for one or more partitions: Status 8524 - The DSA operation is unable to proceed because of a DNS lookup failure

Knowledge Base article:

External

http://go.microsoft.com/fwlink/?LinkId=229715

Element properties:

TargetMicrosoft.KnowledgeServices.Windows.Server.AD.ConnectionObject
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
Active Directory replication is failing for one or more partitions: Status 8524 - The DSA operation is unable to proceed because of a DNS lookup failure
<Details>
<Content>Replication status 8524 was detected. This status indicates that AD replication has failed with error: "The DSA operation is unable to proceed because of a DNS lookup failure" This status means a name resolution issue exists between the source and destination DC. Check the information collected below for more information about the Active Directory partition with the most recent failed replication attempt. See the Knowledge Base article for more information on how to address this issue.</Content>
<CollectedInformation>
<Info>
<Name>NamingContextDN</Name>
<Value>{1}</Value>
</Info>
<Info>
<Name>LastSyncResult</Name>
<Value>{2}</Value>
</Info>
<Info>
<Name>NumConsecutiveSyncFailures</Name>
<Value>{3}</Value>
</Info>
<Info>
<Name>SourceDsaSite</Name>
<Value>{4}</Value>
</Info>
<Info>
<Name>TimeOfLastSyncAttempt</Name>
<Value>{5}</Value>
</Info>
<Info>
<Name>TimeOfLastSyncSuccess</Name>
<Value>{6}</Value>
</Info>
<Info>
<Name>USNLastObjChangeSynced</Name>
<Value>{7}</Value>
</Info>
<Info>
<Name>Writeable</Name>
<Value>{8}</Value>
</Info>
<Info>
<Name>Other partitions with replication problems (if any)</Name>
<Value>{0}</Value>
</Info>
</CollectedInformation>
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.1.0;

Source Code:

<UnitMonitor ID="Monitor_AK550654" Comment="SupportTopic=TBD;VersionNumber=1.0.1.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesWindowsServerADLibrary!Microsoft.KnowledgeServices.Windows.Server.AD.ConnectionObject" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessage73d26e55eb0f4564b3fc8e55dfcca4b7">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='AllNamingContextDNs']$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='NamingContextDN']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='LastSyncResult']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='NumConsecutiveSyncFailures']$</AlertParameter4>
<AlertParameter5>$Data/Context/Property[@Name='SourceDsaSite']$</AlertParameter5>
<AlertParameter6>$Data/Context/Property[@Name='TimeOfLastSyncAttempt']$</AlertParameter6>
<AlertParameter7>$Data/Context/Property[@Name='TimeOfLastSyncSuccess']$</AlertParameter7>
<AlertParameter8>$Data/Context/Property[@Name='USNLastObjChangeSynced']$</AlertParameter8>
<AlertParameter9>$Data/Context/Property[@Name='Writeable']$</AlertParameter9>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AK550654.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>ConnectionName</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesWindowsServerADLibrary!Microsoft.KnowledgeServices.Windows.Server.AD.ConnectionObject"]/Name$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($ConnectionName)

$ErrorActionPreference = "Stop"

# Set up the arguments
$scriptargs = new-object psobject
$scriptargs | add-member NoteProperty "ConnectionName" $ConnectionName

# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
$scriptoutput | add-member NoteProperty "AllNamingContextDNs" ""
$scriptoutput | add-member NoteProperty "NamingContextDN" ""
$scriptoutput | add-member NoteProperty "LastSyncResult" ""
$scriptoutput | add-member NoteProperty "NumConsecutiveSyncFailures" ""
$scriptoutput | add-member NoteProperty "SourceDsaSite" ""
$scriptoutput | add-member NoteProperty "TimeOfLastSyncAttempt" ""
$scriptoutput | add-member NoteProperty "TimeOfLastSyncSuccess" ""
$scriptoutput | add-member NoteProperty "USNLastObjChangeSynced" ""
$scriptoutput | add-member NoteProperty "Writeable" $false


Function GetReplicationStatus([string] $SourceDsaCN, [int] $LastSyncResultToQuery) {
Get-WmiObject -Class msad_replneighbor -namespace root\microsoftactivedirectory |
Where-Object {($_.LastSyncResult -eq $LastSyncResultToQuery) -and ($_.SourceDsaCN -eq $SourceDsaCN)} |
Sort-Object TimeOfLastSyncAttempt
}

function AdvisorRule($scriptargs, $scriptoutput)
{
$scriptoutput.HasIssue=$false

$ErrorNumber = 0

#ConnectionName argument comes in DOMAIN\COMPUTERNAME. We need only the COMPUTERNAME to compose the $SourceDsaCN
$SourceDsaCN = $ScriptArgs.ConnectionName.Split("\")[1]

$LastSyncResultToQuery = 8524

$replneighbor = GetReplicationStatus $SourceDsaCN $LastSyncResultToQuery

If ($replneighbor -ne $null)
{
$NamingContextDNs = ""
$NamingContextDNArray = @()
foreach ($neighbor in $replneighbor)
{
$ErrorNumber++

If ($ErrorNumber -eq 1)
{
$scriptoutput.NamingContextDN = $neighbor.NamingContextDN
$scriptoutput.LastSyncResult = $neighbor.LastSyncResult
$scriptoutput.NumConsecutiveSyncFailures = $neighbor.NumConsecutiveSyncFailures
$scriptoutput.SourceDsaSite = $neighbor.SourceDsaSite
$scriptoutput.TimeOfLastSyncAttempt = [management.managementDateTimeConverter]::ToDateTime($neighbor.TimeOfLastSyncAttempt).AddMinutes([System.TimeZoneInfo]::Local.BaseUtcOffset.TotalMinutes * -1)
$scriptoutput.TimeOfLastSyncSuccess = [management.managementDateTimeConverter]::ToDateTime($neighbor.TimeOfLastSyncSuccess).AddMinutes([System.TimeZoneInfo]::Local.BaseUtcOffset.TotalMinutes * -1)
$scriptoutput.USNLastObjChangeSynced = $neighbor.USNLastObjChangeSynced
$scriptoutput.Writeable = $neighbor.Writeable
}
else
{
$NamingContextDNArray += "(" + $neighbor.NamingContextDN + ")"
}
}

if ($ErrorNumber -gt 0)
{
$scriptoutput.AllNamingContextDNs = [string]::Join(", ", $NamingContextDNArray)
$scriptoutput.HasIssue = $true
}
}
}
AdvisorRule $scriptargs $scriptoutput

# set the output
$mom = new-object -comobject "MOM.ScriptAPI"
$bag = $mom.CreatePropertyBag()

if ($scriptoutput.HasIssue -ne $null)
{
$bag.AddValue("HasIssue", $scriptoutput.HasIssue)
}

if ($scriptoutput.AllNamingContextDNs -ne $null)
{
$bag.AddValue("AllNamingContextDNs", $scriptoutput.AllNamingContextDNs)
}

if ($scriptoutput.NamingContextDN -ne $null)
{
$bag.AddValue("NamingContextDN", $scriptoutput.NamingContextDN)
}

if ($scriptoutput.LastSyncResult -ne $null)
{
$bag.AddValue("LastSyncResult", $scriptoutput.LastSyncResult)
}

if ($scriptoutput.NumConsecutiveSyncFailures -ne $null)
{
$bag.AddValue("NumConsecutiveSyncFailures", $scriptoutput.NumConsecutiveSyncFailures)
}

if ($scriptoutput.SourceDsaSite -ne $null)
{
$bag.AddValue("SourceDsaSite", $scriptoutput.SourceDsaSite)
}

if ($scriptoutput.TimeOfLastSyncAttempt -ne $null)
{
$bag.AddValue("TimeOfLastSyncAttempt", $scriptoutput.TimeOfLastSyncAttempt)
}

if ($scriptoutput.TimeOfLastSyncSuccess -ne $null)
{
$bag.AddValue("TimeOfLastSyncSuccess", $scriptoutput.TimeOfLastSyncSuccess)
}

if ($scriptoutput.USNLastObjChangeSynced -ne $null)
{
$bag.AddValue("USNLastObjChangeSynced", $scriptoutput.USNLastObjChangeSynced)
}

if ($scriptoutput.Writeable -ne $null)
{
$bag.AddValue("Writeable", $scriptoutput.Writeable)
}

$bag

</Script></ScriptBody>
<SnapIns/>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>86384</Schedule>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<Not>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Not>
</SuccessExpression>
</Configuration>
</UnitMonitor>