How to modify several dn in one time

Chris Dukes pakrat at ftp.linux.org.uk
Wed Nov 4 03:43:48 CET 2009


On Wed, Nov 04, 2009 at 10:27:15AM +0800, Zhang Huangbin wrote:
> Hi, list.
> 
> it seems .modify() or .modify_s() can only modify one dn in one time.  
It doesn't just seem, it *IS*

> How can i modify several dn in one time?

Issue multiple .modify()s.
Collect the .result()s to make sure they worked.

> 
> 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

That shouldn't work either.

ldapmodify -c <INSERT YOUR AUTH PARAMETERS HERE> << EEOOTT
# This is one LDIF record
dn: cn=foo,dc=xxx
changetype: modify
add: sn
sn: baz
-

#This is a SECOND LDIF record
dn: cn=bar,dc=xxx
changetype: modify
add: sn
sn: quf
-


> 
> 
> 
> -- 
> Best Regards.
> 
> Zhang Huangbin
> 
> - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
>   CentOS, Debian, Ubuntu: http://www.iredmail.org/
> 
> 


More information about the python-ldap mailing list