Thanks for the response. It turned out to be a brain error. After reading the
documentation a little more closely, I found my mistake. I had to change this
line of code:
my $result = $ldap->modify($sdEnt->dn(), replace => { 'member' =>
@memberArray });
to this:
my $result = $ldap->modify($sdEnt->dn(), add => { 'member' =>
$memberArray });
The value passed needs to be a reference to an array if you are passing a list,
not an array like I was doing. I also change 'replace' to 'add' because that's
really what I wanted to do.
AG
> -----Original Message-----
> From: Eric Nichols [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 02, 2006 2:47 PM
> To: Giuoco, Aaron
> Subject: Re: Copying members from one group to another in Active
> Directory
>
>
> The member attribute consists of the DN's of the member
> objects in the directory.
>
> To copy these you need to translate the dn's to the ldap
> context of the
> destination server AND those objects MUST exist in the destination.
>
> On Mon, January 2, 2006 3:08 pm, Giuoco, Aaron wrote:
> > Probably a simple answer, but how do you add members to a
> group with the LDAP
> > module?
> >
> > On a test group, I have tried pushing the contents the
> member attibute of my
> > source group into the member attribute of my destination
> group, but that
> > didn't work. Here is the relevant code:
> >
> >
> > my $result = $ldap->modify($sdEnt->dn(), replace => {
> 'member' => @memberArray
> > });
> >
> > if ($result->code == 0) {
> > print "Group addition completed successfully.\n";
> > } else {
> > print "!!!!!!! Group addition failed !!!!!!!!!\n";
> > print "ERROR: " . $result->error . "\n";
> > }
> >
> >
> > @memberArray is the list that was retrieved from the member
> attribute of the
> > source group. When my script hits this if() statement, it
> errors out with the
> > following message:
> >
> >
> > !!!!!!! Group addition failed !!!!!!!!!
> > ERROR: 00000057: LdapErr: DSID-0C090A85, comment: Error in attribute
> > conversion operation, data 0, vece
> >
> >
> > What format is Active Directory expecting for group
> members? How can I
> > transform the list I get from the member attribute to the
> expected format?
> > Thanks!
> >
> > ___________________________
> > Aaron Giuoco
> > Assistant Systems Admin
> > Atlantia Offshore Limited
> > e: [EMAIL PROTECTED]
> > ph: 281-899-4385
> >
>
>