(Server 2008 R2) Active Directory returns the UID attribute (not the GUID) in Base64 instead of plain text?


hello,

we have application makes use of an active directory (server 2008 r2) setup own forest , domain. use ldap directory , dns services.

we create ad accounts in ad have particular uid value (e.g. uid=cn=\"my, name\", ou=somewhere, o=yes, c=ca). note: we're not using ad guid, rather ldap attribute uid.

our application executes ldap query on ad by filtering on uid value to retrieve specific ad account, , properties (i.e. ad account status , group membership).

when application executes following ldap query, no results found (i've executed same query on ad server itself, using ldifde, , nothing returned):

- target dn:ou=subhere,dc=xyz,dc=local

- search scope: sub

- filter: ( & (objectclass=user) (uid=cn=\"my, name\", ou=somewhere, o=yes, c=ca) )

- attributes return: samaccountname,memberof

ldifde -f testldap_loggedinuser.txt -s localhost -v -d "ou=subhere,dc=xyz,dc=local" -p subtree -r "( & (objectclass=user) (uid=cn=\"my, name\", ou=somewhere, o=yes, c=ca) )" -l "objectclass,samaccountname,memberof"

> no entries found

and if retrieve ad account filtering on samaccountname (instead of uid), see value have in uid attribute, i'll results uid outputed in base64 encoding. i.e. execute following ldidfde:

ldifde -f testldap_filteraccountname.txt -s localhost -v -d "ou=subhere,dc=xyz,dc=local" -p subtree -r "(&(objectclass=user)(samaccountname=my.account))" -l "objectclass,samaccountname,uid".

i output:

dn: cn=my account,ou=subhere,dc=xyz,dc=local
changetype: add
objectclass: top
objectclass: person
objectclass: organizationalperson
objectclass: user
samaccountname: my.account
uid:: q049ik15lcboyw1liiwgt1u9u09nrvdirvjflcbppvlfuywgqz1dqq==

could share lights on this?

is there configuration settings i'm missing on ad enable querying on uid attribute?

note: have setup 2nd ad (forest/domain) same way on different server, testing purposes. , working expected (application retrieving ad account, , if execute above ldfifde queries uid in plain text). new environment we're in doesn't behave same  , can't figure out different between them. appreciated.

thanks,

captain

ok found problem: between keyboard , chair.

but know.

the uid value entered copy pasted email. therefore quotes different , caused ad respond base64 encoded version.

i.e. instead of having:

cn="my, name", ou=somewhere, o=yes, c=ca

i had

cn=˝my, name˝, ou=somewhere, o=yes, c=ca

by manually typing in right quotes (i.e. notepad equivalent quotes), solved it.

thanks richard!

captain



Windows Server  >  Directory Services



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client