LDAP Python Query differing results from built in linux tool ldapquery -
i'm having issues retrieving attributes ldap server using python ldap script.
first off, can pull using linux command ldapsearch
if run ldapsearch -lll uid=user
, not specify host want hit, not of attributes want.
however, if run ldapsearch -lll -h ldaphost uid=user
of attributes available. i'm chalking 1 ldap server having more attributes need.
anyway, python script...here's script i'm executing:
# initialize , bind con = ldap.initialize('ldaphost') con.simple_bind_s() # run query against directory basedn = "basedn" searchscope = ldap.scope_subtree retrieveattributes = none searchfilter = uid=user res = con.search_s(basedn, searchscope, searchfilter, retrieveattributes) print res
when run python script, output exact same list of attributes achieved when execute ldapsearch -lll uid=user
...it's python script not connecting desired host , pulling attributes ldap host give me.
is there additional piece need add script specify ldap host? seems doing in second line of script, i'm not ldap guru , doing wrong. appreciated.
thanks.
Comments
Post a Comment