Leser: 2
1 Eintrag, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl -w
use strict;
use Net::LDAP;
#,debug=>2
my $ad = Net::LDAP->new("192.168.2.254",debug=>2) or die "$@";
$ad->bind("Administrator\@hive.loc",password=>'12345');
my $searchbase = 'OU=Benutzer,OU=HIVE,DC=hive,DC=loc';
my $filter = "memberof=*";
my $attrs = "proxyAddresses";
my $result = $ad->search(base=>$searchbase,filter=>$filter,attrs=>$attrs);
my $count = $result->count;
if ($count < 1)
{
print $result->error."\n";
} else
{
print $count." Entries found\n";
my $entry;
foreach $entry ($result->entries)
{
foreach my $mail ($entry->get_value("proxyAddresses"))
{
print $mail."\n";
}
}
}
$ad->unbind;
1 Eintrag, 1 Seite |