Beispiel #1
0
        private ExchangePrincipal GetExchangePrincipal(string organizationIdEncoded)
        {
            CacheEntry <ExchangePrincipal> cacheEntry;
            ExchangePrincipal exchangePrincipal;

            if (this.principals.TryGetValue(organizationIdEncoded, DateTime.UtcNow, out cacheEntry))
            {
                exchangePrincipal = cacheEntry.Value;
            }
            else
            {
                OrganizationId organizationId           = AuditRecordDatabaseWriterVisitor.GetOrganizationId(organizationIdEncoded);
                ADUser         tenantArbitrationMailbox = AdminAuditWriter.GetTenantArbitrationMailbox(organizationId);
                exchangePrincipal = ExchangePrincipal.FromADUser(tenantArbitrationMailbox, null);
                this.principals.TryAdd(organizationIdEncoded, DateTime.UtcNow, new CacheEntry <ExchangePrincipal>(exchangePrincipal));
            }
            return(exchangePrincipal);
        }
Beispiel #2
0
 private void GetClientAndRootFolderId(ExchangePrincipal principal, ref EwsAuditClient ewsClient, ref FolderIdType auditRootFolderId)
 {
     ewsClient         = (ewsClient ?? new EwsAuditClient(new EwsConnectionManager(principal, OpenAsAdminOrSystemServiceBudgetTypeType.Unthrottled, this.Tracer), EwsAuditClient.DefaultSoapClientTimeout, this.Tracer));
     auditRootFolderId = (auditRootFolderId ?? AdminAuditWriter.GetAuditRootFolderId(ewsClient));
 }