Advertisement
Guest User

Untitled

a guest
Aug 30th, 2017
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import ldap
  2. url = 'ldap://10.15.120.250'
  3. user = 'myusername@post.ad'
  4. password = 'pass'
  5. conn = ldap.initialize(url)
  6. conn.protocol_version = 3
  7. conn.set_option(ldap.OPT_REFERRALS, 0)
  8. conn.simple_bind_s(user, password)
  9.  
  10. conn.search_ext('cn=base,dc=example,dc=com', ldap.SCOPE_SUBTREE, '(sn=Johnson)')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement