Ejemplo n.º 1
0
 internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
 {
     if (typeof(T) != typeof(ADSiteLink))
     {
         throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
     }
     return(base.GetObjects <T>(session.GetConfigurationNamingContext().GetChildId("Sites"), session, subTreeSession, optionalData, out notFoundReason));
 }
Ejemplo n.º 2
0
 // Token: 0x06001224 RID: 4644 RVA: 0x00057EF5 File Offset: 0x000560F5
 private static ADObjectId GetSearchRootForSession(IDirectorySession session)
 {
     if (session == null)
     {
         throw new ArgumentNullException("session");
     }
     if (!session.UseConfigNC)
     {
         return(session.GetDomainNamingContext());
     }
     return(session.GetConfigurationNamingContext());
 }
Ejemplo n.º 3
0
        // Token: 0x06000DCD RID: 3533 RVA: 0x00029468 File Offset: 0x00027668
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            notFoundReason = null;
            EnumerableWrapper <T> wrapper = EnumerableWrapper <T> .GetWrapper(base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason));

            if (!wrapper.HasElements())
            {
                wrapper = EnumerableWrapper <T> .GetWrapper(this.TryGetObjectsFromDC <T>(rootId, subTreeSession, optionalData));
            }
            if (!wrapper.HasElements() && !Guid.Empty.Equals(this.guid) && typeof(T).IsAssignableFrom(typeof(ADGroup)))
            {
                ADObjectId containerId;
                if (session.SessionSettings.CurrentOrganizationId.Equals(OrganizationId.ForestWideOrgId))
                {
                    containerId = session.GetConfigurationNamingContext();
                }
                else
                {
                    containerId = session.SessionSettings.CurrentOrganizationId.ConfigurationUnit;
                }
                bool    useGlobalCatalog = session.UseGlobalCatalog;
                bool    useConfigNC      = session.UseConfigNC;
                ADGroup adgroup          = null;
                try
                {
                    session.UseGlobalCatalog = true;
                    session.UseConfigNC      = false;
                    adgroup = session.ResolveWellKnownGuid <ADGroup>(this.guid, containerId);
                }
                finally
                {
                    session.UseGlobalCatalog = useGlobalCatalog;
                    session.UseConfigNC      = useConfigNC;
                }
                if (adgroup != null)
                {
                    wrapper = EnumerableWrapper <T> .GetWrapper(new List <ADGroup>(1)
                    {
                        adgroup
                    }.Cast <T>());
                }
            }
            return(wrapper);
        }
Ejemplo n.º 4
0
        public IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (!(session is IDirectorySession))
            {
                throw new ArgumentException("Session should be an IDirectorySession", "session");
            }
            if (rootId != null && !(rootId is ADObjectId))
            {
                throw new ArgumentException("RootId must be an ADObjectId", "rootId");
            }
            IDirectorySession directorySession  = (IDirectorySession)session;
            IDirectorySession directorySession2 = null;

            if (!(this is OrganizationIdParameter) && VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled && rootId == null && ADSessionSettings.GetProcessServerSettings() == null && directorySession is IConfigurationSession)
            {
                IConfigurationSession configurationSession   = directorySession as IConfigurationSession;
                ADObjectId            configurationUnitsRoot = directorySession.GetConfigurationUnitsRoot();
                bool flag = !string.IsNullOrEmpty(this.rawIdentity) && this.rawIdentity.IndexOf("\\") != -1;
                if (this.InternalADObjectId != null)
                {
                    flag = !string.IsNullOrEmpty(this.InternalADObjectId.DistinguishedName);
                }
                if (!flag && configurationSession.UseConfigNC && !configurationUnitsRoot.IsDescendantOf(directorySession.GetConfigurationNamingContext()) && typeof(ADConfigurationObject).IsAssignableFrom(typeof(T)) && !typeof(ADNonExchangeObject).IsAssignableFrom(typeof(T)))
                {
                    T                    t        = (default(T) == null) ? Activator.CreateInstance <T>() : default(T);
                    ADObject             adobject = t as ADObject;
                    ObjectScopeAttribute objectScopeAttribute;
                    bool                 flag2 = adobject.IsApplicableToTenant(out objectScopeAttribute);
                    if (directorySession.SessionSettings.ExecutingUserOrganizationId.Equals(OrganizationId.ForestWideOrgId) && directorySession.SessionSettings.CurrentOrganizationId.Equals(directorySession.SessionSettings.ExecutingUserOrganizationId) && flag2)
                    {
                        directorySession2 = directorySession;
                    }
                }
            }
            if (directorySession2 == null)
            {
                directorySession2 = ADSession.RescopeSessionToTenantSubTree(directorySession);
            }
            return(this.GetObjects <T>((ADObjectId)rootId, directorySession, directorySession2, optionalData, out notFoundReason));
        }