Ldap query in coldfusion isnt working
What I have is a Parent domain with two child domains. I have my ldap querys going to the Global Catolog in the parent domain because I want it to search the domain tree. Is this possiable? I have my code below of what I have.
This doesnt work
<!--- Authentication Type ---->
<cfset args.authtype = "LDAP">
<cfset args.server = "172.22.0.122">
<cfset args.port = "389">
<cfset args.start = "CN=Users,DC=domain,DC=org">
<cfset args.suser = "username">开发者_StackOverflow;
<cfset args.spwd = "password">
<cfset args.queryString = "sAMAccountName={username},CN=Person,CN=Schema,CN=Configuration,DC=domain,DC=org">
This does work
<!--- Authentication Type ---->
<cfset args.authtype = "LDAP">
<cfset args.server = "172.22.0.122">
<cfset args.port = "389">
<cfset args.start = "CN=Users,DC=domain,DC=org">
<cfset args.suser = "username">
<cfset args.spwd = "password">
<cfset args.queryString = "CN={username},OU=Crete-Users,DC=subdomain,DC=domain,DC=org">
Assuming this is a MS Active Directory search, you are not searching the global catalog.
According to Microsoft: "Global Catalog queries are directed to port 3268, which explicitly indicates that Global Catalog semantics are required. By default, ordinary LDAP searches are received through port 389. If you bind to port 389, even if you bind to a Global Catalog server, your search includes a single domain directory partition. If you bind to port 3268, your search includes all directory partitions in the forest. If the server you attempt to bind to over port 3268 is not a Global Catalog server, the server refuses the bind."
There are other things to consider as well when doing a global catalog search. Check out this TechNET article for more information.
http://technet.microsoft.com/en-us/library/cc978012.aspx
精彩评论