Ejemplo n.º 1
0
        internal virtual IConfigurationSession CreateConfigurationSession(ADSessionSettings sessionSettings)
        {
            if (sessionSettings == null)
            {
                throw new ArgumentNullException("sessionSettings");
            }
            bool flag = TaskHelper.ShouldPassDomainControllerToSession(this.DomainController, sessionSettings);

            return(DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(flag ? this.DomainController : null, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(this.DomainController) ? null : (flag ? this.NetCredential : null), sessionSettings, 419, "CreateConfigurationSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs"));
        }
Ejemplo n.º 2
0
        private void CreateRootOrgConfigSession()
        {
            ADSessionSettings sessionSettings = ADSessionSettings.FromRootOrgScopeSet();
            bool flag = TaskHelper.ShouldPassDomainControllerToSession(this.DomainController, sessionSettings);

            this.rootOrgGlobalConfigSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(flag ? this.DomainController : null, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(this.DomainController) ? null : (flag ? this.NetCredential : null), sessionSettings, 558, "CreateRootOrgConfigSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            if (!this.rootOrgGlobalConfigSession.IsReadConnectionAvailable())
            {
                this.rootOrgGlobalConfigSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.PartiallyConsistent, sessionSettings, 567, "CreateRootOrgConfigSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            }
            this.rootOrgGlobalConfigSession.UseGlobalCatalog = true;
        }
Ejemplo n.º 3
0
        private void CreateCurrentPartitionTopologyConfigSession()
        {
            ADSessionSettings sessionSettings = OrganizationId.ForestWideOrgId.Equals(base.CurrentOrganizationId) ? ADSessionSettings.FromRootOrgScopeSet() : ADSessionSettings.FromAccountPartitionRootOrgScopeSet(base.CurrentOrganizationId.PartitionId);
            bool flag = TaskHelper.ShouldPassDomainControllerToSession(this.DomainController, sessionSettings);

            this.partitionOrRootOrgGlobalConfigSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(flag ? this.DomainController : null, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(this.DomainController) ? null : (flag ? this.NetCredential : null), sessionSettings, 479, "CreateCurrentPartitionTopologyConfigSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            if (!this.partitionOrRootOrgGlobalConfigSession.IsReadConnectionAvailable())
            {
                this.partitionOrRootOrgGlobalConfigSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.PartiallyConsistent, sessionSettings, 488, "CreateCurrentPartitionTopologyConfigSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            }
            this.partitionOrRootOrgGlobalConfigSession.UseGlobalCatalog = true;
        }
Ejemplo n.º 4
0
        private void CreatePartitionAllTenantsOrRootOrgGlobalCatalogSession()
        {
            ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(base.CurrentOrganizationId);
            bool flag = TaskHelper.ShouldPassDomainControllerToSession(this.DomainController, sessionSettings);

            this.partitionOrRootOrgGlobalCatalogSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(flag ? this.DomainController : null, null, CultureInfo.CurrentCulture.LCID, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(this.DomainController) ? null : (flag ? this.NetCredential : null), sessionSettings, 450, "CreatePartitionAllTenantsOrRootOrgGlobalCatalogSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            if (!this.partitionOrRootOrgGlobalCatalogSession.IsReadConnectionAvailable())
            {
                this.partitionOrRootOrgGlobalCatalogSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(ConsistencyMode.PartiallyConsistent, sessionSettings, 461, "CreatePartitionAllTenantsOrRootOrgGlobalCatalogSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            }
            this.partitionOrRootOrgGlobalCatalogSession.UseGlobalCatalog = true;
        }
Ejemplo n.º 5
0
        internal virtual IRecipientSession CreateTenantGlobalCatalogSession(ADSessionSettings sessionSettings)
        {
            if (sessionSettings == null)
            {
                throw new ArgumentNullException("sessionSettings");
            }
            bool flag = TaskHelper.ShouldPassDomainControllerToSession(this.DomainController, sessionSettings);
            IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(flag ? this.DomainController : null, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(this.DomainController) ? null : (flag ? this.NetCredential : null), sessionSettings, 375, "CreateTenantGlobalCatalogSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");

            if (!tenantOrRootOrgRecipientSession.IsReadConnectionAvailable())
            {
                tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(null, true, ConsistencyMode.PartiallyConsistent, null, sessionSettings, 384, "CreateTenantGlobalCatalogSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
            }
            tenantOrRootOrgRecipientSession.UseGlobalCatalog = true;
            return(tenantOrRootOrgRecipientSession);
        }
        // Token: 0x06000AFC RID: 2812 RVA: 0x00023724 File Offset: 0x00021924
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            TaskLogger.LogEnter();
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (!(session is IConfigurationSession))
            {
                throw new ArgumentException(Strings.ErrorInvalidType(session.GetType().Name), "session");
            }
            if (((typeof(T) == typeof(ADOrganizationalUnit) && session.UseConfigNC) || (typeof(T) == typeof(ExchangeConfigurationUnit) && !session.UseConfigNC)) && !Environment.StackTrace.Contains("Microsoft.Exchange.Management.Deployment.OrganizationTaskHelper.GetExchangeConfigUnitFromOrganizationId"))
            {
                throw new ArgumentException("Session is using the wrong Naming Context for the desired search");
            }
            notFoundReason = null;
            EnumerableWrapper <T> result = EnumerableWrapper <T> .Empty;

            if (base.IsMultitenancyEnabled())
            {
                if (this.IsWildcardDefined(base.RawIdentity))
                {
                    if (null == this.AccountPartition)
                    {
                        notFoundReason = new LocalizedString?(Strings.ErrorOrganizationWildcard);
                        return(result);
                    }
                    IEnumerable <ExchangeConfigurationUnit> configurationUnits = this.GetConfigurationUnits((IConfigurationSession)session, base.RawIdentity);
                    return(EnumerableWrapper <T> .GetWrapper((IEnumerable <T>) configurationUnits, this.GetEnumerableFilter <T>()));
                }
                else
                {
                    OrganizationId organizationId = this.ResolveOrganizationId(session.SessionSettings.CurrentOrganizationId);
                    if (!OrganizationId.ForestWideOrgId.Equals(organizationId))
                    {
                        ADSessionSettings adsessionSettings = ADSessionSettings.FromCustomScopeSet(ScopeSet.ResolveUnderScope(organizationId, session.SessionSettings.ScopeSet), session.SessionSettings.RootOrgId, organizationId, session.SessionSettings.ExecutingUserOrganizationId, true);
                        adsessionSettings.TenantConsistencyMode = TenantConsistencyMode.IncludeRetiredTenants;
                        bool flag = TaskHelper.ShouldPassDomainControllerToSession(session.DomainController, adsessionSettings);
                        ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(flag ? session.DomainController : null, session.ReadOnly, session.ConsistencyMode, flag ? session.NetworkCredential : null, adsessionSettings, 314, "GetObjects", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\IdentityParameter\\organizationidparameter.cs");
                        tenantConfigurationSession.UseConfigNC      = session.UseConfigNC;
                        tenantConfigurationSession.UseGlobalCatalog = session.UseGlobalCatalog;
                        if (typeof(ExchangeConfigurationUnit) == typeof(T) && organizationId.ConfigurationUnit != null)
                        {
                            List <ExchangeConfigurationUnit> list = new List <ExchangeConfigurationUnit>();
                            ExchangeConfigurationUnit        exchangeConfigurationUnit = tenantConfigurationSession.Read <ExchangeConfigurationUnit>(organizationId.ConfigurationUnit);
                            if (exchangeConfigurationUnit != null)
                            {
                                list.Add(exchangeConfigurationUnit);
                                result = EnumerableWrapper <T> .GetWrapper((IEnumerable <T>) list, this.GetEnumerableFilter <T>());
                            }
                        }
                        else if (organizationId.OrganizationalUnit != null)
                        {
                            List <ADOrganizationalUnit> list2 = new List <ADOrganizationalUnit>();
                            ADOrganizationalUnit        adorganizationalUnit = tenantConfigurationSession.Read <ADOrganizationalUnit>(organizationId.OrganizationalUnit);
                            if (adorganizationalUnit != null)
                            {
                                list2.Add(adorganizationalUnit);
                                result = EnumerableWrapper <T> .GetWrapper((IEnumerable <T>) list2, this.GetEnumerableFilter <T>());
                            }
                        }
                    }
                }
            }
            TaskLogger.LogExit();
            return(result);
        }
Ejemplo n.º 7
0
        private void CreateGlobalConfigSession()
        {
            bool flag = TaskHelper.ShouldPassDomainControllerToSession(this.DomainController, ADSessionSettings.FromRootOrgScopeSet());

            this.globalConfigSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(flag ? this.DomainController : null, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(this.DomainController) ? null : (flag ? this.NetCredential : null), ADSessionSettings.FromRootOrgScopeSet(), 433, "CreateGlobalConfigSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\DataAccessTask.cs");
        }