I'm working with Access 2003 and already have a code that extracts a lot of data from LDAP. Here is what I got:
Set rootDSE = GetObject("LDAP://RootDSE")
domainContainer = rootDSE.Get("defaultNamingContext")
conn.provider = "ADSDSOObject"
conn.Open "ADs Provider"
ldapStr = "<LDAP://" & domainContainer & ">;(& (mailnickname=" & nickname & ") (| (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ));adspath;subtree"
exchangeRS.Open ldapStr, conn, adOpenStatic, adLockReadOnly
exchangeRS.MoveFirst
Do Until exchangeRS.EOF
Set oUser = GetObject(exchangeRS.fields(0).value)
' The properties below are working
'oUser.firstName
'oUser.displayName
'oUser.title
'oUser.telephoneNumber
'oUser.mobile
'oUser.faxNumber
'oUser.streetAddress
'oUser.l
'oUser.postalCode
'oUser.mail
Next
I'm able to get a lot of informations for each person in the LDAP database. However, I would also like to get the structural unit. However, oUser.organizationUnit
doesn't exit and oUser.OU
only contains the top unit, which isn't what I want.
Is there any way to list all properties of oUser to find the right one? Is the ldapStr
missing something?
Here is an image of what I want to get (sorry it it's in French):
Is it possible that this is not stored in LDAP? If not, any way to get it from Outlook address book? But I would really prefer getting it from LDAP actually, as every other single information is actually there (which tends me to believe this should be there too).
The result of all my testing showed me that this data isn't stored in LDAP.