title: How to read the contents of active directory using python-ldap?
body: <p>My script is like this:</p>
  
  <pre><code>import ldap, sys
  server = 'ldap://my_server'
  l = ldap.initialize(server)
  dn="myname@mydomain"
  pw = "password"
  l.simple_bind_s(dn,pw)
  ldap.set_option(ldap.OPT_REFERRALS,0)
  print "valid"
  </code></pre>
  
  <p>I am using Python 2.7 on windows.</p>
  
  <p>Is there any method to read or get the contents of active directory? </p>