Mapping GAL entry to AD properties

T

Tadwick

I have an app that runs in Outlook and allows the user to retrieve recipients
via the GAL. (I'm using Redemption to do this.) So far I have been using
the EntryID as a unique identifier for a mailbox; however, I gather this
property is not static so I'm wondering how best to map a GAL recipient to an
AD property like a GUID.

Any assistance with this would be appreciated.


Thanks, Tad
 
E

Eric Legault [MVP - Outlook]

Can you tell me more about how a user's mailbox fits into your solution, as
well why you need to associate a recipient with an AD property? This will
better allow me to validate your approach.
 
T

Tadwick

Well, as I indicated, "legacyExchangeDN" may map to the address entry's
Address property but I don't know how reliably. It would be better if there
were a static property of the address entry that mapped to an AD GUID.
 
D

D.Lee

Tad,

Why won't the SMTPAddress property of the Redemption GAL entry get you want
you need? There should only be one account with a given SMTP address. If
you know that address, then something like this will work.

'Assumes that strAddress is the SMTPAddress retrieved via Redemption
Set rsDetails = CreateObject("ADODB.Recordset")
rsDetails.ActiveConnection = "Provider=ADSDSOObject"
rsDetails.Source = "SELECT ADsPath FROM 'LDAP://DomainName' WHERE
objectClass='user' AND objectCategory='Person' AND mail='" & strAddress & "'"
rsDetails.CursorType = 0
rsDetails.CursorLocation = 2
rsDetails.LockType = 1
rsDetails.Open()
While Not rsDetails.EOF
With rsDetails
Debug.Print .Fields("ADsPath")
rsDetails.MoveNext
End With
Wend
rsDetails.Close
Set rsDetails = Nothing
 
D

Dmitry Streblechenko

legacyExchangeDN is p robably teh way to go.
AFAIK legacyExchangeDN is what Exchange itself uses to map a mailbox to an
AD user.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
T

Tadwick

Here is what I learned today from an MS employee on AD's Mail, ProxyAddresses
and LegacyExchangeDN attributes:

"Normally, the AD Mail attribute will match up with the Primary SMTP Address
that is viewed under the ProxyAddresses attribute. Exchange does not use the
Mail field, though, so I cannot guarantee it will always match.

As far as the ProxyAddresses attribute goes, if you look at the entries, you
will see that one of the SMTP entries will be capitalized.

i.e. as follows

SMTP: (e-mail address removed)
smtp: (e-mail address removed)
smtp: (e-mail address removed)

The address that shows SMTP in all caps is the primary (reply-to) address.
All other secondary addresses will have smtp listed in lowercase.

The LegacyExchangeDN normally should not match up to any current e-mail
address entries. The format of the legacyExchangeDN is an x500 format. If
you have done a cross-organization mailbox move, the OLD legacyExchangeDN
should show up as an X500 entry to preserve the ability to reply to old
messages."


(Dimitry, how does Redemption get RDOAddressEntry.Address, which appears the
same as legacyExchangeDN?)
 
T

Tadwick

Accodring to http://msdn2.microsoft.com/en-us/library/ms530980.aspx the
following are all valid examples of PR_EMAIL_ADDRESS:

network/postoffice/user
(e-mail address removed)
/c=US/a=att/p=Microsoft/o=Finance/ou=Purchasing/s=Furthur/g=Joe

This suggests that mapping this property via RDOAddressEntry.Address may not
always match the x500 format of AD's LegacyExchangeDN (although maybe it does
for Exchange addresses, I don't know). If this is true I think it would be
safer to map RDOAddressEntry.SMTPAddress to AD's ProxyAddresses even though
the filter may be a bit more work.
 
D

Dmitry Streblechenko

That is exactly how RDOAddressEntry.SMTPAddress works (but your original
question was about RDOAddressEntry.Address ) - Redemption retrieves the
address prefixed with "SMTP:" (all caps) from the PR_EMS_AB_PROXY_ADDRESSES
multivalued property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
T

Tadwick

Thanks for clarifying that Dimitry.

Dmitry Streblechenko said:
That is exactly how RDOAddressEntry.SMTPAddress works (but your original
question was about RDOAddressEntry.Address ) - Redemption retrieves the
address prefixed with "SMTP:" (all caps) from the PR_EMS_AB_PROXY_ADDRESSES
multivalued property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top