How to modify several dn in one time

Michael Ströder michael at stroeder.com
Wed Nov 4 18:15:43 CET 2009


Zhang Huangbin wrote:
> it seems .modify() or .modify_s() can only modify one dn in one time.  
> How can i modify several dn in one time?

You can't. These methods strictly follow the LDAP functional model (see RFC
4511, section 4.6. Modify Operation).

> Such as ldapadd command:
> 
> # ldapadd -x -D 'cn=Manager,dc=xxx,dc=xxx' -wpasswd -f new.ldif
> 
> Content of new.ldif:
> 
> dn: cn=vmail,dc=xxx,dc=xxx
> changetype: modify
> add: cn
> cn: newCN
> cn: newCN2
> --
> dn: cn=user01,dc=xxx,dc=xxx
> changetype: modify
> cn: newCN
> cn: newCN2

These will lead to sevaral add requests being sent by command-line tool
ldapadd. Same with ldapmodify reading several change records from LDIF file
and sending a modify request for each of these.

Ciao, Michael.




More information about the python-ldap mailing list