Perform an LDAP bind (Perl)

This code can be found in Chapter 4 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 Win32::OLE;
my $DSO = Win32::OLE->GetObject('LDAP:');
my $User = $DSO->OpenDSObject('LDAP://cn=jdoe,ou=New York, ou=Americas,' .
                                                'ou=Users,dc=xyz,dc=com',
                              'administrator@xyz.com',
                              'password',
                              0);

This code has been viewed 1207 times.

New from the creators of TechTasks.com: StatSheet.com