I'm working on a script to import a bunch of sendmail aliases as LDAP groups. Once I
have created the initial group, I want to add rfc822MailMembers and uniqueMembers to
it. SO I have something like this (largely pilfered from the Examples doc):
while (<ALIASES>) {
chomp;
($groupname,@groupmembers) = split /:/;
# Create the group entry here
my $createArray = [
objectClass => [ "top", "groupOfUniqueNames",
"inetMailGroup", "inetLocalMailRecipient",
"inetMailGroupManagement", "nsManagedMailList" ],
cn => "$groupname",
mail => "[EMAIL PROTECTED]",
mailHost => "mail.foo.com",
inetMailGroupStatus => "active"
];
my $newDN = "cn=$groupname,$grpdn";
print "Creating group: $groupname\n";
print "dn: $newDN\n";
LDAPentryCreate($ldap, $newDN, $createArray);
# Now add the group members
print "Group $groupname has the following members:\n";
foreach $groupmember (@groupmembers) {
Previously (other scripts) I had used $entry->add(FOO) to add attributes to an $entry
object. But now I don't have an entry object right? LDAPentryCreate does not return an
entry object to me? So how do I go about adding my members to this new created group?
Do I need to do a search to acquire an $entry object, or is there a better way to do
this? Some way to add the members to the createArray prior to calling LDAPentrycreate?
--
Mark Drummond
Technical Specialist
STANTIVE Solutions Inc. - Kingston, ON, Canada
Sun Microsystems Independent Sales Organization (ISO)
T] 613.634.7410 ext.226 E] [EMAIL PROTECTED]
F] 613.634.7412 W] www.stantive.com