my $result = $ad->search(base=>$path,filter=>"cn=*",attrs=>"cn"); my $manager = $result->entry(0)->get_value('managedBy'); $result = $ad->search(base=>$manager,filter=>"cn=*",attrs=>"cn"); #print decodeCertSubject($result->entry(0)->get_value('userCertificate')) . "\n"; my ($oneline, $cn) = decodeCertSubject($result->entry(0)->get_value('userCertificate'));