I'm trying to search the whole of our AD for computer objects (using the Perl Net::LDAP module). I just put in as searchbase:
my $searchbase='DC=com,DC=unet,DC=auckland,DC=ac,DC=nz'; Looking for computers so I put in: my $filter="(&(objectclass=User)(objectcategory=computer))"; I do a search: my $results=$ad->search(base=>$searchbase,filter=>$filter,attrs=>$attrs); (scope=>'sub' is supposed to be the default, but I have also tried with: my $results=$ad->search(base=>$searchbase,filter=>$filter,scope=>'sub',attr s=>$attrs); ) I don't get everything. If I put in a full OU: my $searchbase='OU=Staff Computers,OU=COM Computers,DC=com,DC=unet,DC=auckland,DC=ac,DC=nz'; I get objects under that OU. I haven't yet looked to see whether my scope=>'sub' search gets some of those computers or not. But I don't want to look under a particular OU; I want to look in the whole AD - one of the things I am looking for is computers that have got into the wrong location. jj John Thayer Jensen, System Administrator Computing Service, School of Business University of Auckland Room 256, 15 Wynyard Street voice: +64 9 373-7599 ext 87543 FAX: +64 9 373-7696 mobile: +64 21 049-7702 quickdial: 60001 http://staff.business.auckland.ac.nz/~j.jensen
