public ADEvent GetOUParent(ADEvent anOU) { if (IsRootOU(anOU)) { return(null); } string parentCandidateDN = GetParentString(anOU); ADAttributes parentCandidateAttributes = AttributeLoader.Load(parentCandidateDN); // lookup direct parent in Active Directory; ADEvent parentCandidate = WrapInEvent(parentCandidateAttributes); // we add this check before the “fictive” check to avoid fictive flags on roots if (IsRootOU(parentCandidate)) { return(parentCandidate); } // we skip fictive parents if (IsFictive(parentCandidate)) { return(GetOUParent(parentCandidate)); } return(parentCandidate); }
public ADEvent GetImmediateParent(ADEvent anOU) { if (IsRootOU(anOU)) { return(null); } string parentCandidateDN = GetParentString(anOU); ADAttributes parentCandidateAttributes = AttributeLoader.Load(parentCandidateDN); // lookup direct parent in Active Directory; ADEvent parentCandidate = WrapInEvent(parentCandidateAttributes); return(parentCandidate); }
private static ADEvent WrapInEvent(ADAttributes attributes) { return(new ADEvent(0, OperationType.Update, ObjectType.OU, attributes, System.DateTime.Now, null)); }