Whats is this format called? “/o=First Organization/ou=First Administrative Group/cn=Recipients/cn=user”

StackOverflow https://stackoverflow.com/questions/7362820

Question

What format is the following string called in regards to Microsoft Exchange?

/o=First Organization/ou=First Administrative Group/cn=Recipients/cn=user

I've seen this using LDAP, but now seeing it CDO 1.2.1 and ultimately trying to convert it to an email address like user@domain.com. Thanks.

Was it helpful?

Solution

It's called legacy Exchange distinguished name and is a remnant from Exchange 5.5.

You can either resolve this address using the ResolveNames method (http://msdn.microsoft.com/en-us/library/exchangewebservices.exchangeservicebinding.resolvenames(v=exchg.140).aspx) of the EWS Managed API, call the EWS WebService method ResolveName directly.

Another option is to use LDAP and search for the user object with the property legacyExchangeDN set to your address. Then, query the proxyAddress attribute and retrieve the one address which is prefixed with "SMTP:" (all uppercase).

OTHER TIPS

The method Henning's link is deprecated with Exchange 2013.

Now the recommended way is to do it through ExchangeService.ResolveName() and retrieve the STMP address from the Mailbox property.

public string ResolveToSmtpAddress(string address)
{
    try
    {
        NameResolutionCollection nrc = _service.ResolveName(address);

        foreach (var add in nrc)
        {
            return add.Mailbox.Address;
        }
        return null;
    }
    catch (Exception)
    {
        throw;
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top