Link to home
Start Free TrialLog in
Avatar of sulzener
sulzenerFlag for United States of America

asked on

Access the Active Directory in Exchange 2000 usinf LDAP

I would like to list (and eventually update) some of the profile data in our Active Directory on our company intranet.  I have read multiple LDAP articles to try and get it to work.  Rather confused.  Here is my environment:
Server A: CFMX 6.1
Server B: DC running Windows Server 2003

Can Someone Fix this Sample Code:
<cfset usern = "username@domainname">  //Have also tried "domainname\username"
<cfset passw = "password">

<cfldap action="QUERY"
name="GetUsers"
attributes="cn"
start="dc=thedomaincontroller,dc=com"  
server="thedomaincontroller or IPaddress"  
username="#usern#"  
password="#passw#">

<cfoutput query="GetUsers">
#cn# <BR>
</cfoutput>

My problems could also include authority.   I have tried a username that has READ access to the Active Directory and also the Administrator username.

Any samples or corrections would be welcome.  Regards, sulzener
Avatar of Tacobell777
Tacobell777

What exactly is not working? Any errors?
ASKER CERTIFIED SOLUTION
Avatar of jyokum
jyokum
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sulzener

ASKER

mrichmon,
I am still not sure how to cleanup questions I've asked where the advise has all been very good and welcomed, but the sugestions given just didn't work for me.  On this particular question, I think the problem is with my lack of foundational understanding of LDAP.  Not with the suggestions given.   It could also be a problem with my particular setup.  Sooo ... how am I supposed to respond to this question?  Do I request a delete?  I feel bad not awarding point.  I also think the advise would be great for other EE users.  It just didn't work for me.  Please advise ... sulzener
In that case I think it would be useful to give the points to jyokum perhaps with a grade of B which means that it helped, but was not the excat answer to your problem.
solzener, I did aks you if you could tell us what is not working, if there are any errors, you did not respond to that.
tacobell, using the above posted example (at the beginning), I get this message "Inappropriate authentication".
I have also tried getting jyokum's example to work. I'm really not sure what my "ADserver variable" should be: an IP address or not?  
Also, not sure what the "ADdomain variable" should be.  It seems anything I try I get  "Inappropriate authentication".  
Sorry it has taken so long to reply to this.
as far as setting the variables...

ADserver - would be the DNS name or IP address of "Server B: DC running Windows Server 2003" you referenced in your original question

ADdomain - would be the name of the domain (example: experts-exchange.com)
This should work:
<cfldap action="QUERY"
name="ADQL_select_all_users"
attributes="sn,givenname,telephoneNumber,homePhone,pager,mobile,userAccountControl,mail,user,sAMAccountName"
start="cn=users,dc=#dc#,dc=org"
scope="subtree"
filter="(&(objectclass=user))"
server="#adserver#"
username="#ldapAdminUser#"
password="#ldapAdminPass#"
sort="sn"
sortControl="asc, nocase">

The #username# and #password# are of an administrator account in AD.
The #dc# is wchealth (in our org)


Then:
      <cfif #ADQL_select_all_users.recordCount# IS NOT "0">
      <cfoutput query="ADQL_select_all_users">
                </cfoutput>
                </cfif>