Skip to main content
nikos101
Inspiring
June 25, 2009
Answered

Windows authenticate, and return LDAP cn and OBJECTSID

  • June 25, 2009
  • 1 reply
  • 1076 views

Hi there CF people:

I want a company member to Windows authenticate and based on the matching user I need a query that coldfusion submits and returns some attributes like the cn and OBJECTSID

I've tried stuff like this but this only returns what the filter wants, I need what I described above.

<cfldap
          server = "myserver"
          action = "query"
          name = "results"
          start = "dc=domain,dc=com"
        
         filter="name="
          attributes = "name,cn,ObjectSid,Current-Location"
         username="Ho\nikos"
               
        password= "secret"
       
            >

Many thanks for any tips

    This topic has been closed for replies.
    Correct answer tclaremont

    Here is what I use...

    <cfldap action="QUERY" name="results"
            attributes="name,employeenumber,memberof,title,mail,telephonenumber,givenname,sn,SAMAccountName,l,st,streetaddress,postalcode,physicalDeliveryOfficeName,department"
    start="DC=YourDomain,DC=org"
    filter="SAMAccountName=#Trim(NameToCheck)#"
    server="ldap.YourDomain.org"
    username="YourDomain\YourUserName"
    password="YourPassword">

    Note that your oganization may or may not use cn or OBJECTSID. Add them to the attributes section shown above, and then do a CFDUMP to see what happens.

    1 reply

    tclaremont
    tclaremontCorrect answer
    Inspiring
    June 25, 2009

    Here is what I use...

    <cfldap action="QUERY" name="results"
            attributes="name,employeenumber,memberof,title,mail,telephonenumber,givenname,sn,SAMAccountName,l,st,streetaddress,postalcode,physicalDeliveryOfficeName,department"
    start="DC=YourDomain,DC=org"
    filter="SAMAccountName=#Trim(NameToCheck)#"
    server="ldap.YourDomain.org"
    username="YourDomain\YourUserName"
    password="YourPassword">

    Note that your oganization may or may not use cn or OBJECTSID. Add them to the attributes section shown above, and then do a CFDUMP to see what happens.

    nikos101
    nikos101Author
    Inspiring
    June 26, 2009

    Awsome dude you've saved my day

    nikos101
    nikos101Author
    Inspiring
    June 26, 2009

    SAMAccountName was what I wanted