[python-ldap] ldap operation

Michael Ströder michael at stroeder.com
Fri Sep 30 20:26:31 EDT 2016


Felipe_G0NZÁLEZ_SANTIAG0 wrote:
> I 'm new using python-ldap. I'm cannot run any LDAP operation. I work with a
> Samba4 AD.
> This is my code:
>     import ldap
>     import ldap.modlist as modlist
> 
>     l.ldap(ldap://127.0.0.1)
      ^^^^^^^^^^^^^^^^^^^^^^^^
This code line looks completely bogus.

Please see Demo/initialize.py in the source distribution on how to connect and bind.

>     l.protocol_version=ldap.VERSION3
>     l.simple_bind=("CN=Administrator,CN=Users,DC=example,DC=com", "mypassw0rd")
>     #trying to delete a user
>     dn= "CN=pepe,CN=Users,DC=example,DC=com"
>     l.delete(dn)
>     l.unbind()
> 
> And then user pepe persist, I mean wasn' t deleted.
> 
> Any idea?

Any error message? Any logs?

Ciao, Michael.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3829 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20161001/0f1e42b1/attachment.bin>


More information about the python-ldap mailing list