I was able to get attributes about an user by doing queries on LDAP using Python ldap but I don't know how to obtain his DN.
Remark: Doing CN=sAMAccount,base_dn)
is not valid because the user can be somewhere in another sub-tree.
Which is the proper way of getting the DN
for an user for which I do have the sAMAccount
?