// Token: 0x0600032C RID: 812 RVA: 0x00011758 File Offset: 0x0000F958 private static TenantPartitionCacheItem FindTenantInfoByAcceptedDomain(string acceptedDomain) { PartitionId partitionId; if (!ADSessionSettings.IsGlsDisabled) { TenantPartitionCacheItem tenantPartitionCacheItem; if (ADAccountPartitionLocator.TryLookUpAccountForest(Guid.Empty, acceptedDomain, null, out tenantPartitionCacheItem)) { return(tenantPartitionCacheItem); } } else if (ADAccountPartitionLocator.IsSingleForestTopology(out partitionId)) { ExTraceGlobals.GLSTracer.TraceDebug <string>(0L, "GLS is disabled, performing the only partition lookup for {0}", acceptedDomain); return(ADAccountPartitionLocator.SearchForTenantInfoByOrganizationName(acceptedDomain, partitionId)); } if (GlsMServDirectorySession.ShouldScanAllForests) { ADAccountPartitionLocator.LoadPartitionCacheIfNecessary(); PartitionId[] array = ADAccountPartitionLocator.allAccountPartitionIds; foreach (PartitionId partitionId2 in array) { TenantPartitionCacheItem tenantPartitionCacheItem = ADAccountPartitionLocator.SearchForTenantInfoByOrganizationName(acceptedDomain, partitionId2); if (tenantPartitionCacheItem != null) { ADAccountPartitionLocator.InsertCacheMaps(tenantPartitionCacheItem, acceptedDomain, null); return(tenantPartitionCacheItem); } } } return(null); }
// Token: 0x0600031E RID: 798 RVA: 0x00010DF0 File Offset: 0x0000EFF0 public static Guid GetExternalDirectoryOrganizationIdByTenantName(string tenantName, PartitionId partitionId) { if (string.IsNullOrEmpty(tenantName)) { throw new ArgumentNullException("tenantName"); } if (partitionId == null) { throw new ArgumentNullException("partitionId"); } ADAccountPartitionLocator.LoadPartitionCacheIfNecessary(); TenantPartitionCacheItem tenantPartitionCacheItem; if (!ADAccountPartitionLocator.tenantNamePartitionCache.TryGetValue(tenantName, out tenantPartitionCacheItem)) { tenantPartitionCacheItem = ADAccountPartitionLocator.SearchForTenantInfoByOrganizationName(tenantName, partitionId); if (tenantPartitionCacheItem != null) { ADAccountPartitionLocator.InsertCacheMaps(tenantPartitionCacheItem, null, null); } } if (tenantPartitionCacheItem != null) { ADAccountPartitionLocator.EnsureRegisteredAccountPartition(tenantPartitionCacheItem); return(tenantPartitionCacheItem.ExternalOrgId); } throw new CannotResolveTenantNameException(DirectoryStrings.CannotResolveTenantNameByAcceptedDomain(tenantName)); }