Copy link to clipboard
Copied
Hello,
Im trying to convert the following value into its 'actual' value:
The value is generated from a guid attribute coming straight from LDAP. What is the best way to convert this value into its actual guid value?
Any and all assistance is appreciated.
Copy link to clipboard
Copied
I'm guessing the value is not being returned as a string. Which, if any, of the conversion functions in CF have you tried to use?
Copy link to clipboard
Copied
Thanks for the reply. Ive moved forward a bit now and am returning the value in binary format from my CFLDAP query using the returnasbinary="objectguid".And then using BinaryEncode(value,"Hex") to convert it to a string. I don't believe this is the correct format though, there are no dashes in it as a 'normal' GUID typically looks like. Is there a better way?
Copy link to clipboard
Copied
I haven't tried for a number of years - so this could go back a number of CF versions, and this might be out-of-date info - but the last time I tried it was not possible to fetch binary data from Active Directory using CFLDAP. CFLDAP munged the value (the binary data could be fetched fine using other LDAP clients, so it was CFLDAP getting it wrong)
You might want to have a google around the plkace to see if there's any archived discussion on this (I'm sure I would have brought it up in the old forums...?)
--
Adam
Copy link to clipboard
Copied
Thanks for the replies. @Adam - I think the returnbinary attribute is new as of 7 or 8.
In my searching I have stumbled onto this houseoffusion thread:
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:46529
Within the thread above I found a link to this CFC. Im going to give it a whirl and see how it goes.
http://www.cflib.org/index.cfm?event=page.udfbyid&udfid=705
Another alternative is JLDAP, which requires an executable to be placed in the lib (which Im not allowed)
http://www.numtopia.com/terry/programming/code_java_ldap.cfm
Copy link to clipboard
Copied
The solution above has fullfilled my needs. Thanks all.