Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 private static ADEvent WrapInEvent(ADAttributes attributes)
 {
     return(new ADEvent(0, OperationType.Update, ObjectType.OU, attributes, System.DateTime.Now, null));
 }