Question

I'm using Net::LDAP to perform some operations on an openldap server.

I'm interested in performing a number of simultaneous operations, O1, O2 .. On. The normal way to do so would be to perform them sequentially with each operation involving at least 1 round trip to the server. I want to perform all of these ops within a single round trip.

Can this be achieved? I'm mostly interested in adding a directory structure 2-3 levels deep in one go.

Was it helpful?

Solution

LDAP protocol does not have batch or match-more operations, and every operation must be performed separately on each entry in the DIT.

If you're trying to do bulk addition or bulk modifications you should always take a look at ldapadd and ldapmodify command line programs, they operate on ldif format, and (of course) perform in sequence operations specified in a given ldif file.

In your case you could use or in your case Net::LDAP::LDIF to create ldif file, and call ldapadd or ldapmodify with that file as an argument.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top