daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LDAP_URL = "ldap://ldap-server.my-company.com"
  2. USER = "ldap-user"
  3. PASSWORD = "ldap-password"
  4.  
  5. conn = ldap.initialize(LDAP_URL)
  6. conn.simple_bind_s(USER, PASSWORD)
  7.  
  8. # the base_dn where you want to start the search, play with different params here
  9. base_dn = "OU=Users,DC=corp,DC=<your-company>,DC=com"
  10.  
  11. # search for the user with this attribute. Do a search for some user with this and then
  12. # looking at the output, you can add a more complex search with all the other
  13. # attributes that you see there.
  14. search_dn = "(sAMAccountName=user-id)"
  15. conn.search_s(base_dn, ldap.SCOPE_SUBTREE, search_dn)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top