我想从我工作的 LDAP 服务器上传用户列表,以作为公司目录上传到我们的 wiki。
如何使用 Perl 从 LDAP 服务器下载用户列表?
谢谢。
最佳答案
use Net::LDAP;
$ldap = Net::LDAP->new( 'ldap.bigfoot.com' ) or die "$@";
$mesg = $ldap->bind ; # an anonymous bind
$mesg = $ldap->search( # perform a search
base => "c=US",
filter => "(&(sn=Barr) (o=Texas Instruments))"
);
$mesg->code && die $mesg->error;
foreach $entry ($mesg->entries) { $entry->dump; }
$mesg = $ldap->unbind; # take down session
关于perl - 如何使用 Perl 从 LDAP 服务器下载用户列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/442653/