コード例 #1
0
        private static bool IsValidLegacyDN(string address)
        {
            if (string.IsNullOrEmpty(address))
            {
                throw new ArgumentNullException("address");
            }
            LegacyDN legacyDN;

            return(LegacyDN.TryParse(address, out legacyDN));
        }
コード例 #2
0
        internal static string FixFakeRedirectLegacyDNIfNeeded(string legacyDN)
        {
            LegacyDN legacyDN2;

            if (!LegacyDN.TryParse(legacyDN, out legacyDN2))
            {
                return(legacyDN);
            }
            return(ExchangeRpcClientAccess.FixFakeRedirectLegacyDNIfNeeded(legacyDN2).ToString());
        }
コード例 #3
0
        private static Guid GetMailboxGuidFromPersonalizedLegacyDN(string personalizedMailboxLegacyDN)
        {
            Guid     empty = Guid.Empty;
            LegacyDN legacyDN;

            if (!string.IsNullOrWhiteSpace(personalizedMailboxLegacyDN) && LegacyDN.TryParse(personalizedMailboxLegacyDN, out legacyDN))
            {
                string text;
                string address;
                legacyDN.GetParentLegacyDN(out text, out address);
                GuidHelper.TryParseGuid(new SmtpAddress(address).Local, out empty);
            }
            return(empty);
        }
コード例 #4
0
        private static ADUser GetAdUser(IRecipientSession recipientSession, string scope, bool throwIfNotFound)
        {
            LegacyDN legacyDN;
            ADUser   aduser;

            if (LegacyDN.TryParse(scope, out legacyDN))
            {
                aduser = (recipientSession.FindByLegacyExchangeDN(scope) as ADUser);
            }
            else
            {
                aduser = recipientSession.FindADUserByExternalDirectoryObjectId(scope);
            }
            if (aduser == null && throwIfNotFound)
            {
                throw new ComplianceTaskPermanentException("Recipient not found: " + scope, UnifiedPolicyErrorCode.FailedToOpenContainer);
            }
            return(aduser);
        }
コード例 #5
0
ファイル: RfriContext.cs プロジェクト: YHZX2013/exchange_diff
        internal RfriStatus GetFQDNFromLegacyDN(string legacyDN, out string serverFQDN)
        {
            RfriStatus rfriStatus = RfriStatus.Success;

            serverFQDN = null;
            RfriContext.ReferralTracer.TraceDebug <string>((long)this.ContextHandle, "Requested DN: {0}", RfriContext.GetString(legacyDN));
            if (legacyDN.Contains("@"))
            {
                LegacyDN legacyDN2;
                if (LegacyDN.TryParse(legacyDN, out legacyDN2))
                {
                    string text;
                    legacyDN2.GetParentLegacyDN(out text, out serverFQDN);
                    if (string.IsNullOrEmpty(serverFQDN) || !serverFQDN.Contains("@"))
                    {
                        rfriStatus = RfriStatus.NoSuchObject;
                    }
                }
                else
                {
                    rfriStatus = RfriStatus.NoSuchObject;
                }
            }
            else
            {
                legacyDN   = ExchangeRpcClientAccess.FixFakeRedirectLegacyDNIfNeeded(legacyDN);
                rfriStatus = ServerFqdnCache.LookupFQDNByLegacyDN(legacyDN, out serverFQDN);
            }
            if (rfriStatus != RfriStatus.Success || string.IsNullOrEmpty(serverFQDN))
            {
                if (rfriStatus == RfriStatus.Success)
                {
                    rfriStatus = RfriStatus.NoSuchObject;
                }
                this.ProtocolLogSession[ProtocolLog.Field.Failures] = RfriContext.GetString(legacyDN);
            }
            else
            {
                RfriContext.ReferralTracer.TraceDebug <string>((long)this.ContextHandle, "Referring to {0}", serverFQDN);
            }
            return(rfriStatus);
        }
コード例 #6
0
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            TaskLogger.LogEnter();
            notFoundReason = null;
            IEnumerable <T> result = new List <T>();

            if (typeof(Database).IsAssignableFrom(typeof(T)) && !string.IsNullOrEmpty(base.RawIdentity))
            {
                LegacyDN legacyDN = null;
                if (LegacyDN.TryParse(base.RawIdentity, out legacyDN))
                {
                    QueryFilter filter = new ComparisonFilter(ComparisonOperator.Equal, DatabaseSchema.ExchangeLegacyDN, base.RawIdentity);
                    result = base.PerformPrimarySearch <T>(filter, rootId, session, true, optionalData);
                }
            }
            else
            {
                result = base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason);
            }
            TaskLogger.LogExit();
            return(result);
        }
コード例 #7
0
        private static bool IsValidExAddress(string address)
        {
            LegacyDN legacyDN;

            return(LegacyDN.TryParse(address, out legacyDN));
        }
コード例 #8
0
        // Token: 0x060008D4 RID: 2260 RVA: 0x0001EDC8 File Offset: 0x0001CFC8
        protected ServerIdParameter(string identity) : base(identity)
        {
            if (base.InternalADObjectId != null)
            {
                return;
            }
            LegacyDN legacyDN;

            if (!ADObjectNameHelper.ReservedADNameStringRegex.IsMatch(identity) && !ServerIdParameter.IsValidName(identity) && !ServerIdParameter.IsValidFqdn(identity) && !LegacyDN.TryParse(identity, out legacyDN))
            {
                throw new ArgumentException(Strings.ErrorInvalidIdentity(identity), "identity");
            }
            this.fqdn = identity;
            if (identity.EndsWith(".", StringComparison.Ordinal))
            {
                this.fqdn = identity.Substring(0, identity.Length - 1);
            }
        }