The task is to establish a connection to an Active Directory or Lightweight Directory Access Protocol server.

using LDAPClient
 
conn = LDAPClient.LDAPConnection("ldap://localhost:10389")
LDAPClient.simple_bind(conn, "user", "password")
LDAPClient.unbind(conn)
 