Getting to AD from CDO

  • Thread starter Thread starter Jerry Camel
  • Start date Start date
J

Jerry Camel

I've got a form that allows a user to select thier manager from the Address
Book, via CDO.
It seems that the display name is the value that is returned. I need to
figure out the AD Distinguished Name so I can set the manger property in AD.

Any insight is appreciated.

Jerry
 
How do you access the Manager property? Note that Manager is an object
property (AddressEntry), not a string.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
The name returned is an AddressEntry in CDO, but I need to convert it to a
Distinguished Name to put into the AD Manager property.

I was hoping that there was an easy way to do that. As it is, I'm searching
AD for the matching DisplayName and then pulling the DN from the resulting
User object.

Does that make more sense?

Jerry
 
How do you access it? Note that Name is the default property of the
AddressEntry object, so when you access it like
MsgBox User.Manager
you get back the value of the default property (since MsgBox needs a string,
it knows that Manager is an object and reads its default property).
If you use
MsgBox User.Manager.Address
instead (explicitly specify the property that you are after) you will get
what you need: an EX type address.

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

- I can't find a good reference that specifies all the fields available in
the object.
- I need an AD Distinguished Name, not an Exchange Address...

Since E2K and AD are integrated, I figured I might be able to pull the DN
from the AddressEntry object, but I can't find a way to do that.

Jerry
 
Look at the CDO 1.21 type library or use OutlookSpy (url below) - click
CDO|Session, select CurrentUser property, click Browse.
To see the Extended MAPI properties that can be accessed using
AddressEntry.Fields collection, select the MAPIOBJECT property of the
AddressEntry object and click Browse. Or click IMAPISession, then
QueryIdentity.
Note that you can replace "/" with "," in the EX address to get the AD DN.

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