Example #1
0
        internal static Dictionary <Guid, AdTagData> GetAllTags()
        {
            IConfigurationSession              tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(false, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 49, "GetAllTags", "f:\\15.00.1497\\sources\\dev\\infoworker\\src\\common\\ELC\\AdTagReader.cs");
            ExchangeConfigurationContainer     exchangeConfigurationContainer       = tenantOrTopologyConfigurationSession.GetExchangeConfigurationContainer();
            ADPagedReader <RetentionPolicyTag> allAdTags = tenantOrTopologyConfigurationSession.FindPaged <RetentionPolicyTag>(exchangeConfigurationContainer.Id, QueryScope.SubTree, null, null, 0);

            AdReader.Tracer.TraceDebug(0L, "Found Policy Tags in the AD.");
            List <RetentionPolicyTag>    theGoodTags = AdTagReader.GetTheGoodTags(allAdTags);
            Dictionary <Guid, AdTagData> dictionary  = new Dictionary <Guid, AdTagData>();

            foreach (RetentionPolicyTag retentionPolicyTag in theGoodTags)
            {
                AdTagData value = AdTagReader.FetchTagContentSettings(retentionPolicyTag);
                dictionary[retentionPolicyTag.RetentionId] = value;
            }
            return(dictionary);
        }
Example #2
0
        internal static void LoadTagsInOrg(OrganizationId orgId, Dictionary <Guid, AdTagData> allTags)
        {
            IConfigurationSession configurationSession;

            if (SharedConfiguration.IsDehydratedConfiguration(orgId))
            {
                configurationSession = SharedConfiguration.CreateScopedToSharedConfigADSession(orgId);
            }
            else
            {
                ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(orgId);
                configurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(false, ConsistencyMode.PartiallyConsistent, sessionSettings, 375, "LoadTagsInOrg", "f:\\15.00.1497\\sources\\dev\\infoworker\\src\\common\\ELC\\AdTagReader.cs");
            }
            ADPagedReader <RetentionPolicyTag> allAdTags = configurationSession.FindPaged <RetentionPolicyTag>(null, QueryScope.SubTree, null, null, 0);

            AdReader.Tracer.TraceDebug(0L, "Found Policy Tags in the AD.");
            List <RetentionPolicyTag> theGoodTags = AdTagReader.GetTheGoodTags(allAdTags);

            foreach (RetentionPolicyTag retentionPolicyTag in theGoodTags)
            {
                AdTagData value = AdTagReader.FetchTagContentSettings(retentionPolicyTag);
                allTags[retentionPolicyTag.RetentionId] = value;
            }
        }