public static IEnumerable <ADUser> GetUMEnabledUsersInDatabase(MailboxDatabase database)
        {
            QueryFilter filter = UMMailbox.GetUMEnabledUserQueryFilter(database);

            foreach (PartitionId partitionId in ADAccountPartitionLocator.GetAllAccountPartitionIds(true))
            {
                ADSessionSettings           settings        = ADSessionSettings.FromAllTenantsPartitionId(partitionId);
                ITenantRecipientSession     session         = DirectorySessionFactory.Default.CreateTenantRecipientSession(null, null, LcidMapper.DefaultLcid, true, ConsistencyMode.IgnoreInvalid, null, settings, 199, "GetUMEnabledUsersInDatabase", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\PartitionDataAggregator.cs");
                ADPagedReader <ADRecipient> recipientReader = session.FindPaged(null, QueryScope.SubTree, filter, null, 0);
                foreach (ADRecipient recipient in recipientReader)
                {
                    ADUser user = recipient as ADUser;
                    if (user != null)
                    {
                        yield return(user);
                    }
                }
            }
            yield break;
        }
Exemplo n.º 2
0
        // Token: 0x06000AC2 RID: 2754 RVA: 0x00046A90 File Offset: 0x00044C90
        private Hashtable GetUMEnabledUsersEnterprise(MailboxDatabase database)
        {
            Hashtable hashtable = new Hashtable();

            if (database != null)
            {
                QueryFilter                 umenabledUserQueryFilter = UMMailbox.GetUMEnabledUserQueryFilter(database);
                ADSessionSettings           sessionSettings          = ADSessionSettings.FromRootOrgScopeSet();
                IRecipientSession           recipientSession         = DirectorySessionFactory.Default.CreateRootOrgRecipientSession(true, ConsistencyMode.IgnoreInvalid, sessionSettings, 1260, "GetUMEnabledUsersEnterprise", "f:\\15.00.1497\\sources\\dev\\MailboxAssistants\\src\\assistants\\mwi\\MwiAssistant.cs");
                ADPagedReader <ADRecipient> adpagedReader            = recipientSession.FindPaged(null, QueryScope.SubTree, umenabledUserQueryFilter, null, 0);
                foreach (ADRecipient adrecipient in adpagedReader)
                {
                    ADUser aduser = adrecipient as ADUser;
                    if (aduser != null)
                    {
                        hashtable.Add(aduser.ExchangeGuid, aduser.OrganizationId);
                    }
                }
            }
            return(hashtable);
        }