Hello Mr. Barr
Thank you very much for your work and development on the net::ldap package for Perl. I am sorry to bother you but, I can’t seen to get around this problem I have searched exhaustively looking for an example or text describing how to accomplish my task. Would you please point me in the correct direction to answer my question. Through your documentation I was able to complete part of my objective which is to search our active directory and get specific information about a specific user. The end result is I need to pass a list of userID’s to my program and get information about them and then put that information into a text file. To debug and test my program I hard coded all the variable into my program and everything worked great however when I try to input any variable during the execution of my program it just hangs and then I get a I/O timeout error. I can seem to find any documentation on how to interject a variable into the program from either from the command line or a text file read into the program. I included my code in this email if you would look at it to see if I am using the wrong functions to accomplish what I am trying to do. Any help you will give me will be greatly appreciated thank you in advance for your help.
The test code I added after I was able to get the program running is between the “#” . What I was trying to do was two things make the program usable by someone other than myself that is why I added the (2) lines asking for your ZID(loginID) and password and the 3rd line asking for ZID to search on. The original intent was to pass only ZID’s from a text file to the program to get information about the users.
use strict;
use Net::LDAP;
##################################################
system("clear");
print("Enter your ZID: ");
my $sMyZid = <STDIN>;
chop $sMyZid;
print("Enter your northamerica PW: ");
my $sPw = <STDIN>;
chop $sPw;
system("clear");
print("Enter ZID to search for: ");
my $sZid = <STDIN>;
chop $sZid;
##################################################
# Connection and binding parameters
my $dc = 'my domain';
my $user = 'my loginname';
my $passwd = 'my password';
my $port = '3268';
my $host = 'my hostname';
# Search parameters
my $base = "dc=myCompany,dc=net";
my $scope = "subtree";
my $filter = "(&(objectclass=user)(objectcategory=user)(sAMAccountName=sZid))";
my @attrs = qw(cn mail telephoneNumber physicalDeliveryOfficeName l co);
my $ldap = Net::LDAP->new($dc, hostname => $host, port => $port) or die $@;
my $rc = $ldap->bind( $user, password => $passwd,);
die $rc->error if $rc->code;
#----------------#
# Callout A
#----------------#
my $search = $ldap->search (
base => $base,
scope => $scope,
filter => $filter,
attrs => [EMAIL PROTECTED]
);
die $search->error if $search->code;
#----------------#
# Callout B
#----------------#
foreach my $entry ($search->entries) {
$entry->dump;
}
$ldap->unbind;
Thanks Randy
Randy Briggin
Information Technology
1441 W. Long Lake Rd.
Troy Michigan, 48098
MC: 480-415-220
Telephone: 248-267-0963
Fax: 248-267-8840
email: [EMAIL PROTECTED]
************************************************************************ ****************
Note: The information contained in this message may be privileged and confidential and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.
************************************************************************ ****************