Hello Christian,

I don't know the exact syntax for ldapsearch because I haven't used it for ages.

filter => '*' indeed is no valid filter.  It is a bit like trying an SQL command like SELECT contextCSN FROM $table WHERE *

If I remember correctly, you either need to omit the filter:

$search = $ldap->search(
    base   => $BaseDn,
    scope  => 'base',
    attrs  => [ 'contextCSN'],
);

or set on which attribute you search for:

$search = $ldap->search(
    base   => $BaseDn,
    scope  => 'base',
    filter => '(contextCSN=*)',
    attrs  => [ 'contextCSN'],
);

Also see the examples for search in https://metacpan.org/pod/distribution/perl-ldap/lib/Net/LDAP.pod and for the syntax https://metacpan.org/pod/distribution/perl-ldap/lib/Net/LDAP/Filter.pod

BTW: it's better to copy&paste code, because the code you gave in your call for help will never compile, see the red annotations in your code example.

Kind regards

Strat



Am 15.07.2019 um 16:53 schrieb Christian:
Hi,

could need some help.

I want to do with Net::LDAP what ldapsearch is doing with:
ldapsearch -x -LLL -s base contextCSN

with Net::LDAP I am struggeling ... tried the following:

$search =ldap->search( base => $BaseDn, scope =>''base', filter =>
'*', attrs =>'contextCSN']  );

This results in Bad filter.
 From man page of ldapsearch there is no filter defined ... so is this
possible with Net::LDAP ?

Thank you


Reply via email to