Guest User

Untitled

a guest
Dec 5th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import ldap3
  2.  
  3. ldap_conn = ldap3.Connection('ldapserver', raise_exceptions=True,
  4. auto_bind=True, user='me', password='mypassword')
  5.  
  6. my_dn = "attrib1=blahblah, ou=org1, dc=dc1, dc=dcroot"
  7.  
  8. ldap_conn.search(
  9. search_base=my_dn,
  10. search_filter= '(????)', # required
  11. search_scope=ldap3.BASE,
  12. attributes='*'
  13. )
  14.  
  15. print ldap_conn.response
Add Comment
Please, Sign In to add comment