Hello all,

I am new to the Net::LDAP module (and Perl in general) however I have
quickly learned the basics of OO programming with Perl. I currently have
been working on a script that is supposed to take a list of users (one
username per line) and remove them from a defined group on an OpenLDAP
server. My current method for achieving this goal is as follows:

a) Lookup $group on the LDAP server to make sure it exists
b) If the group exists, I then have the script open the input file (Defined
by $ARGV[0])
c) Set contents of input file equal to an array (chomp newline characters
off each element)
c) For each line in the input array, resolve the user's DN by performing a
search (uid=$_)
d) If the user is found, then remove the individual from the ldap directory

While I figured that a user sometimes will exist on the LDAP server however
not be a member of $group, I added the functionality to determine membership
by use of status code for the modification. While this seems to work I am
wondering if there is a better way to structure my script? Is it possible to
search a group's attributes for the user's entry and then some how store
that attribute's value as a scalar? I will happily post my current code if
requested. Thanks again!

Dan

Reply via email to