Hi,

i try to get the list of the X400 connectors in my exchange 5.5 site by using 
perl-ldap but i do not retrieve anything.
Do you have an idea ?

Here is the code :
#!/usr/bin/perl -w 

use Net::LDAP; 

$ldap = Net::LDAP->new('sgnetex7') or die "$@"; 
 
$ldap->bind ; # an anonymous bind 

$mesg = $ldap->search (  # perform a search 
base   => "o=SAINT-GOBAIN",
scope  => 'sub',
filter => "(objectClass=RFC1006-X400-Link)" 
); 

$mesg->code && die $mesg->error;

my $max = $mesg->count;
print "$max";

for( my $index = 0 ; $index < $max ; $index++) 
  {
    my $entry = $mesg->entry($index);
    my $dn = $entry->dn; # Obtain DN of this entry


    @attrs = $entry->attributes; # Obtain attributes for this entry.
    foreach my $var (@attrs)
    {
     #get a list of values for a given attribute
     $attr = $entry->get_value( $var, asref => 1 );
     if ( defined($attr) )         
     {          
         foreach my $value ( @$attr )          
         {           
          print "$var: $value\n";  # Print each value for the attribute.
         }         
     }                                                                       
    }
  }



$ldap->unbind;   # take down session 

exit 0;

Thanks for your help,

St�phane

Reply via email to