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); } }
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); }