Exemplo n.º 1
0
        internal static string GetExternalLegacyDN(ADUser user)
        {
            string y = FreeBusyFolder.GetOrganizationLegacyDN(user.LegacyExchangeDN) + "/ou=External (FYDIBOHF25SPDLT)";

            foreach (ProxyAddress proxyAddress in user.EmailAddresses)
            {
                if (proxyAddress.Prefix == ProxyAddressPrefix.X500)
                {
                    string oulegacyDN = FreeBusyFolder.GetOULegacyDN(proxyAddress.AddressString);
                    if (oulegacyDN != null && StringComparer.OrdinalIgnoreCase.Equals(oulegacyDN, y))
                    {
                        return(proxyAddress.AddressString);
                    }
                }
            }
            return(FreeBusyFolder.GenerateExternalLegacyDN(user.LegacyExchangeDN));
        }
Exemplo n.º 2
0
        internal static string GetInternalLegacyDN(ADUser user, string targetLegacyDN)
        {
            string x = FreeBusyFolder.GetOrganizationLegacyDN(user.LegacyExchangeDN) + "/ou=External (FYDIBOHF25SPDLT)";

            foreach (ProxyAddress proxyAddress in user.EmailAddresses)
            {
                if (proxyAddress.Prefix == ProxyAddressPrefix.X500)
                {
                    string oulegacyDN = FreeBusyFolder.GetOULegacyDN(proxyAddress.AddressString);
                    if (oulegacyDN != null && !StringComparer.OrdinalIgnoreCase.Equals(x, oulegacyDN) && FreeBusyFolder.IsGeneratedLegacyDN(proxyAddress.AddressString))
                    {
                        return(proxyAddress.AddressString);
                    }
                }
            }
            string oulegacyDN2 = FreeBusyFolder.GetOULegacyDN(targetLegacyDN);

            if (oulegacyDN2 != null)
            {
                return(FreeBusyFolder.GenerateInternalLegacyDN(oulegacyDN2));
            }
            return(null);
        }