Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing LDAP/Active Directory object properties with CFLDAP

Status
Not open for further replies.

jdaniels

Technical User
Apr 23, 2002
63
GB
Hi,

In writing a CF Active Directory client, it seems the only properties I can access are the current 'cn' (in this case, Users), the 'givenname' and the 'sn'. Here's the code:

[cfldap action="QUERY"
name="getUsers"
start="cn=John Smith, cn=users, dc=pdc, dc=mycompany,dc=com"
scope="subtree"
attributes="cn, sn, givenname, c"
username="trusteduser"
password="password"
server="ldapservername"
sort = "cn ASC"
port="389"
timeout="10"]

Then I display the results:

[cfoutput query="getUsers"]
#cn#: Mr.#sn# (#givenname#) from #c# ![/cfoutput]

Which displays only:

John Smith: Mr Smith (John) from !

As you can see, it omits the country property value. I have looked in the active directory schema with ADSI Edit, which states that Country name is represented by 'c' and that it has some data in it for the user John Smith. Yet it doesn't get displayed.

Do I need to set it's accessibility somehow, or some other workaround?

Thanks,

Jonathan Daniels
 
For debugging, try getting and dumping all attributes:
Code:
<cfldap action=&quot;QUERY&quot;
name=&quot;getUsers&quot;
start=&quot;cn=John Smith,cn=users,dc=pdc,dc=mycompany,dc=com&quot;
scope=&quot;subtree&quot;
attributes=&quot;*&quot;
username=&quot;trusteduser&quot;
password=&quot;password&quot;
server=&quot;ldapservername&quot;
port=&quot;389&quot;>

<CFDUMP var=&quot;#getUsers#&quot;>

just to see if country is accessible at all.






-Carl
 
Yup, when I do CFDUMP it shows c as being 'US'. The same goes for other variables. What exactly does this mean, though?

Thanks for your help.

Jonathan Daniels
 
Actually the variables are now showing in the normal way. Originally, we executed 'bind' from ldp.exe and 'bound' with administrator. However we tried with another machine without running that bind and it worked.

Thanks again for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top