Listing01_Connecting_Net-LDAP (Perl)
This code can be found in
Chapter 3 of Managing Enterprise Active Directory Services
Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.
Find out how to download all of the Perl code from this site.
# ---------------------------------------------------------------------
# From the book "Managing Enterprise Active Directory Services"
# ISBN: 0-672-32125-4
# Copyright (C) 2002 by Addison-Wesley
# Script by Robbie Allen
# ---------------------------------------------------------------------
use Net::LDAP;
$ldap = Net::LDAP->new(‘dc1.xyz.com’) or die “Could not connect: $@”;
$result = $ldap->bind(‘cn=administrator,cn=users,dc=xyz,dc=com’,
password => ‘password’);
die $result->error if $result->code;
# do stuff
$ldap->unbind; # tear down the connection
|
This code has been viewed 1160 times.
|
New from the creators of TechTasks.com:
StatSheet.com
|