// Token: 0x06000FC6 RID: 4038 RVA: 0x00062878 File Offset: 0x00060A78
        public void UpgradePartialIdentity()
        {
            OWAMiniRecipient  owaminiRecipient = null;
            SmtpAddress       smtpAddress      = new SmtpAddress(this.proxyAddress.AddressString);
            IRecipientSession recipientSession = Utilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, smtpAddress.Domain);
            Exception         ex = null;

            try
            {
                owaminiRecipient = recipientSession.FindMiniRecipientByProxyAddress <OWAMiniRecipient>(this.proxyAddress, OWAMiniRecipientSchema.AdditionalProperties);
                if (owaminiRecipient == null)
                {
                    throw new OwaExplicitLogonException(string.Format("The address {0} is an object in AD database but it is not an user", this.proxyAddress), LocalizedStrings.GetNonEncoded(-1332692688), ex);
                }
            }
            catch (NonUniqueRecipientException ex2)
            {
                ex = ex2;
            }
            base.LastRecipientSessionDCServerName = recipientSession.LastUsedDc;
            if (owaminiRecipient == null || ex != null)
            {
                throw new OwaExplicitLogonException(string.Format("Couldn't find a match for {0}", this.proxyAddress.ToString()), string.Format(LocalizedStrings.GetNonEncoded(-13616305), this.proxyAddress), ex);
            }
            this.owaMiniRecipient = owaminiRecipient;
        }
        // Token: 0x06000695 RID: 1685 RVA: 0x00013B64 File Offset: 0x00011D64
        public void UpgradePartialIdentity()
        {
            OWAMiniRecipient owaminiRecipient = null;
            SmtpAddress      smtpAddress      = new SmtpAddress(this.proxyAddress.AddressString);

            ExTraceGlobals.CoreCallTracer.TraceDebug <string>(0L, "OwaMiniRecipientIdentity.UpgradePartialIdentity for smtp: {0}", this.proxyAddress.AddressString);
            IRecipientSession recipientSession = UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, smtpAddress.Domain, null);
            Exception         ex = null;

            try
            {
                owaminiRecipient = recipientSession.FindMiniRecipientByProxyAddress <OWAMiniRecipient>(this.proxyAddress, OWAMiniRecipientSchema.AdditionalProperties);
                if (owaminiRecipient == null)
                {
                    throw new OwaExplicitLogonException(string.Format("The address {0} is an object in AD database but it is not an user", this.proxyAddress), Strings.GetLocalizedString(-1332692688), ex);
                }
            }
            catch (NonUniqueRecipientException ex2)
            {
                ex = ex2;
            }
            if (owaminiRecipient == null || ex != null)
            {
                throw new OwaExplicitLogonException(string.Format("Couldn't find a match for {0}", this.proxyAddress.ToString()), string.Format(Strings.GetLocalizedString(-13616305), this.proxyAddress), ex);
            }
            base.OwaMiniRecipient = owaminiRecipient;
        }
Exemplo n.º 3
0
        public IGenericADUser FindMiniRecipientByProxyAddress(IRecipientSession recipientSession, ProxyAddress proxyAddress, PropertyDefinition[] miniRecipientProperties, out StorageMiniRecipient miniRecipient)
        {
            ArgumentValidator.ThrowIfNull("recipientSession", recipientSession);
            StorageMiniRecipient localMiniRecipient = null;

            this.DoAdCallAndTranslateExceptions(delegate
            {
                localMiniRecipient = recipientSession.FindMiniRecipientByProxyAddress <StorageMiniRecipient>(proxyAddress, miniRecipientProperties);
            }, "DirectoryAccessor::FindMiniRecipientByProxyAddress");
            miniRecipient = localMiniRecipient;
            return(this.TranslateMiniRecipient(miniRecipient));
        }
Exemplo n.º 4
0
        private string EnsureGroupIsInDirectoryCache(GroupMailbox group)
        {
            IRecipientSession tenantOrRootRecipientReadOnlySession = DirectorySessionFactory.Default.GetTenantOrRootRecipientReadOnlySession(base.ADSession, group.OriginatingServer, 350, "EnsureGroupIsInDirectoryCache", "f:\\15.00.1497\\sources\\dev\\Management\\src\\FederatedDirectory\\CreateUnifiedGroupTask.cs");
            ProxyAddress      proxyAddress     = new SmtpProxyAddress(group.PrimarySmtpAddress.ToString(), true);
            OWAMiniRecipient  owaminiRecipient = tenantOrRootRecipientReadOnlySession.FindMiniRecipientByProxyAddress <OWAMiniRecipient>(proxyAddress, OWAMiniRecipientSchema.AdditionalProperties);
            string            text             = (owaminiRecipient != null) ? (owaminiRecipient.IsCached ? "ReadFromCache" : "ReadFromDc") : "NotFound";

            UnifiedGroupsTask.Tracer.TraceDebug((long)this.GetHashCode(), "ActivityId={0}. CreateUnifiedGroupTask.EnsureGroupIsInDirectoryCache: ProxyAddress={1}, DomainController={2}, Result={3}", new object[]
            {
                base.ActivityId,
                proxyAddress,
                group.OriginatingServer,
                text
            });
            return(text);
        }
Exemplo n.º 5
0
        internal static string EnsureGroupIsInDirectoryCache(string perfTrackerPrefix, IRecipientSession readWriteSession, ADUser groupAdUser)
        {
            string result;

            using (new StopwatchPerformanceTracker(perfTrackerPrefix + ".EnsureGroupIsInDirectoryCache", GenericCmdletInfoDataLogger.Instance))
            {
                IRecipientSession tenantOrRootRecipientReadOnlySession = DirectorySessionFactory.Default.GetTenantOrRootRecipientReadOnlySession(readWriteSession, groupAdUser.OriginatingServer, 204, "EnsureGroupIsInDirectoryCache", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\GroupMailbox\\GroupMailboxContext.cs");
                ProxyAddress      proxyAddress     = new SmtpProxyAddress(groupAdUser.PrimarySmtpAddress.ToString(), true);
                ADUser            aduser           = tenantOrRootRecipientReadOnlySession.FindByProxyAddress(proxyAddress) as ADUser;
                OWAMiniRecipient  owaminiRecipient = tenantOrRootRecipientReadOnlySession.FindMiniRecipientByProxyAddress <OWAMiniRecipient>(proxyAddress, OWAMiniRecipientSchema.AdditionalProperties);
                string            text             = string.Format("Querying AD for group. ProxyAddress={0}, DomainController={1}, FoundADUser={2}, FoundOwaMiniRecipient={3}", new object[]
                {
                    proxyAddress,
                    groupAdUser.OriginatingServer,
                    aduser != null,
                    owaminiRecipient != null
                });
                GroupMailboxContext.Tracer.TraceDebug <string>(0L, "{0}", text);
                result = text;
            }
            return(result);
        }