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)); }
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); }
private static string GenerateExternalLegacyDN(string legacyDN) { return(FreeBusyFolder.GetOrganizationLegacyDN(legacyDN) + "/ou=External (FYDIBOHF25SPDLT)/cn=Recipients" + FreeBusyFolder.GetNewCnRdn()); }