Copy link to clipboard
Copied
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
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, an
...Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Awsome dude you've saved my day
Copy link to clipboard
Copied
SAMAccountName was what I wanted
Copy link to clipboard
Copied
I'm trying to figure out how to save the
OBJECTSID
in a readable fromat into ms SQL , could someone give some pointers?
Copy link to clipboard
Copied
returnAsBinary = "objectsid"
seems to fix it.
Copy link to clipboard
Copied
Maybe it would be better to use objectGUID as I need asometime to reference to that does not change.