Hi all, I am trying to use the Net::LDAP module to modify the members of a group and running into some troubles. I was wondering if someone can point me in the right direction with this one... I have the following code
use Net::LDAP; $userDn = "CN=Ext User 1,OU=External,OU=People,DC=test,DC=com"; $groupDn = "CN=Mailing_All,OU=Mailing Lists,OU=Groups,DC=test,DC=com"; my $ldapConnection = Net::LDAP->new('172.16.171.11', port=>'389') or die "$@"; # Now that we are connected to the directory, bind as the specified us +er. $mesg = $ldapConnection->bind('administrator@test.com', password => 'password'); # Perform an LDAP search $queryResult = $ldapConnection->search(base=> 'DC=test,DC=com', filter => '(&(objectClass=group))'); $queryResult->code && die $queryResult->error; foreach $entry ($queryResult->entries) { $entry->dump; } print "time to add: " . $userDn . " to group: " . $groupDn . "\n"; my $result = $ldapConnection->modify ($userDn, add => { 'member' => $groupDn }); print "Error code: " . $result->code . "\n"; print "Error name: " . $result->error_name . "\n"; print "Error text: " . $result->error_text . "\n"; $ldapConnection->disconnect;
When I run it the resulting error is a schema violation.
Error code: 65 Error name: LDAP_OBJECT_CLASS_VIOLATION Error text: The request specifies a change to an existing entry or the + addition of a new entry that does not comply with the servers schema
Does anyone have any tips for me on where I am going wrong? Cheers

In reply to Active Directory Groups Modify by alongwor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.