wrote a simple LDAP script to contact ldap.bigfoot.com

lamzak at hotmail.com lamzak at hotmail.com
Fri Oct 22 08:17:15 EDT 1999


Hi,

I (lamzak at hotmail.com) wrote a simple LDAP script to contact /
retrieve information from ldap.bigfoot.com (or any (?) public LDAP
server). Maybe interesting for others:


# Retrieving information from bigfoot.com / ldap.bigfoot.com using
python LDAP module
# LamZak 1999
# Needs ldap.pyd and LDAP32.DLL (on Windows)
# LDAP API calls are documented in RFC1823
http://www.faqs.org/rfcs/rfc1823.html
#

import ldap, sys

# Open connection to LDAP server:
l = ldap.open("ldap.bigfoot.com", 389) # there must be some beautiful
CONSTANT for 389

# Authenticate to LDAP server:
l.simple_bind_s("","")

# Search:
res = l.search_s("cn=r smith",ldap.SCOPE_SUBTREE,"objectclass=*")

# res = l.search_s("o=gemini",ldap.SCOPE_SUBTREE,"objectclass=*")
	# not OK
# res = l.search_s("mail=gemini",ldap.SCOPE_SUBTREE,"objectclass=*")
	# not OK

print res

# Close the connection:
l.unbind()



Sent via Deja.com http://www.deja.com/
Before you buy.




More information about the Python-list mailing list