in src/IdFix/Rules/DedicatedRuleCollection.cs [122:163]
public override bool Skip(SearchResultEntry entry)
{
string objectDn = String.Empty;
try
{
objectDn = entry.Attributes[StringLiterals.DistinguishedName][0].ToString();
// Any object is filtered if:
// match well known exclusion pattern
if (entry.Attributes[StringLiterals.Cn][0].ToString().EndsWith("$", StringComparison.CurrentCultureIgnoreCase))
{
return true;
}
var exclusionValue = entry.Attributes[StringLiterals.Cn][0].ToString().ToUpperInvariant();
if (Constants.WellKnownExclusions.Select(e => e.ToUpperInvariant()).Any(e => exclusionValue.StartsWith(e, StringComparison.CurrentCultureIgnoreCase)))
{
return true;
}
// •Object is a conflict object (DN contains \0ACNF: )
if (entry.Attributes[StringLiterals.DistinguishedName][0].ToString().IndexOf("\0ACNF:", StringComparison.CurrentCultureIgnoreCase) != -1)
{
return true;
}
// •isCriticalSystemObject is present
if (entry.Attributes.Contains(StringLiterals.IsCriticalSystemObject))
{
if (Convert.ToBoolean(entry.Attributes[StringLiterals.IsCriticalSystemObject][0].ToString(), CultureInfo.CurrentCulture) == true)
{
return true;
}
}
}
catch (Exception ex)
{
this.InvokeStatus(StringLiterals.Exception + "Result Filter: " + objectDn + " " + ex.Message);
}
return false;
}