コード例 #1
0
ファイル: ADSession.cs プロジェクト: YHZX2013/exchange_diff
        internal static void InitializeForestModeFlagForLocalForest()
        {
            string localForestFqdn = TopologyProvider.LocalForestFqdn;

            try
            {
                ADSession.IsTenantConfigInDomainNC(localForestFqdn);
            }
            catch (OrgContainerNotFoundException)
            {
                if (Globals.IsDatacenter)
                {
                    if (Globals.IsMicrosoftHostedOnly)
                    {
                        InternalDirectoryRootOrganizationCache.InitializeForestModeFlagForSetup(localForestFqdn, TenantCULocation.DomainNC);
                    }
                    else
                    {
                        InternalDirectoryRootOrganizationCache.InitializeForestModeFlagForSetup(localForestFqdn, TenantCULocation.ConfigNC);
                    }
                }
                else
                {
                    InternalDirectoryRootOrganizationCache.InitializeForestModeFlagForSetup(localForestFqdn, TenantCULocation.ConfigNC);
                }
            }
            finally
            {
                InternalDirectoryRootOrganizationCache.GetTenantCULocation(localForestFqdn);
            }
        }
コード例 #2
0
ファイル: ADSession.cs プロジェクト: YHZX2013/exchange_diff
        internal static bool IsTenantConfigInDomainNC(string partitionFqdn)
        {
            TenantCULocation tenantCULocation = InternalDirectoryRootOrganizationCache.GetTenantCULocation(partitionFqdn);

            if (tenantCULocation == TenantCULocation.Undefined)
            {
                if (Globals.IsDatacenter)
                {
                    ADSystemConfigurationSession.GetRootOrgContainer(partitionFqdn, null, null);
                    tenantCULocation = InternalDirectoryRootOrganizationCache.GetTenantCULocation(partitionFqdn);
                }
                else
                {
                    tenantCULocation = TenantCULocation.ConfigNC;
                    if (PartitionId.IsLocalForestPartition(partitionFqdn))
                    {
                        InternalDirectoryRootOrganizationCache.InitializeForestModeFlagForSetup(partitionFqdn, tenantCULocation);
                    }
                }
            }
            return(tenantCULocation == TenantCULocation.DomainNC);
        }