This depends on wheter or not your user objects also happen to have an ou
attribute in addition to the structural part of the dn. We populate all
of our users with an ou attribute corresponding to their lowest ou, so
somebody might have "ou=Mathematic Department". If so, you can build that
into the filter (|(ou=dept1)(ou=dept2)). If you don't hae such or if you
are looking higher than is reflected, then you would need to either do
multiple searches with multiple bases or search "dc=tamu,dc=edu" and then
do something like
$dn = $entry-dn;
next unless ( ($dn =~ /ou\=dept1/) or ($dn =~ /ou\=dept2) );
--Jim Harle
On Fri, 2 Feb 2001, Bing Du wrote:
> There are quita a few ou's under "dc=tamu,dc=edu". How should I specify
> the base to just search in two ou's. For instance, what should the
> $basedn be if I just want to look up "cn=john smith" in
> 'ou=dept1,dc=tamu,dc=edu" and 'ou=dept2,dc=tamu,dc=edu"?
>
> $mesg = $ld->search(base => $basedn,scope => 'sub',filter => "(cn=john
> smith)",attrs => [],typesonly => 0);
>
> Thanks,
>
> Bing
>
> Bing Du <bi...@ta..., 979-845-9577>
> Texas A&M University, CIS, Operating Systems, Unix
>
>
|