Chris,
One way would be
my $ldap = Net::LDAP->new(...
$ldap->bind ...
my $base = 1;
while (1) {
my $mesg = $ldap->search (
base => ... ,
filter => (uid = joe$base),
attrs => ... )
last $mesg->count();
... process found ...
}
... process all done
(you need fo fill in the ... stuff appropriately)
This looks like a way to generate new account names. The place where the above
is shaky is that it doesn't take in to account namespace retention times. Here
is an example. Suppose you have 7 joe's and joe2 is deleted. Do you want the
next joe to be joe2 even if he arrives 5 minutes later? If so, the above is
just fine. You need to think through accidental deletions. If not, you need
to figure out how to handle this issue. We do it by having a separate
directory base (o=deleted) for accounts that are gone then remove accounts from
there at the end of our name expiration time.
--Jim Harle
On Mon, 24 Nov 2003, Shields, Christopher wrote:
> Yep sorry.
>
> -----Original Message-----
> From: Jim Harle [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 24, 2003 12:23 PM
> To: Shields, Christopher
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: This maybe simple, but I'm newer
>
> Chris,
> I need a more precise statement of the problem. Does this mean that you
> want
> to look up cn=joe1, then cn=joe2, until you stop finding them?
>
> --Jim Harle
>
> On Mon, 24 Nov 2003, Shields, Christopher wrote:
>
> > I need to do a search based on CN, but increment a counter on the end of
> the
> > cn each time one is found easily.
> > Is this easy to do, I can return all entries OK, but I'm not quite sure
> how
> > to redo the search each time through the loop.
> > Thanks,
> >
> > Chris Shields
> > Waubonsee Community College
> > Network Support Services Manager
> > 630-466-5732
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >
>