Results 1 to 2 of 2

Thread: Remove users from a group with more than 1500 members

  1. #1
    Join Date
    Nov 2007
    Posts
    4

    Default Remove users from a group with more than 1500 members

    Hi!

    I have an Active Directory group with more than 1500 members (~3500). My problem is that when I call removeAttributeValue on DirContextOperations no exception is thrown, but nothing happens. The user still remains member of the group. The code works perfectly with groups less than 1500 members.

    Code:
    DirContextOperations context = ldapTemplate.lookupContext(groupDn);
    context.removeAttributeValue("member", personDn);
    ldapTemplate.modifyAttributes(context);
    I know that there are restrictions on multi-valued attributes in AD. I have found sample codes with wich I can query the members of the given group using range option. But I can't find any solution removing users from a group like this.

    Any help would be appreciated!!
    Last edited by dakrul; Feb 23rd, 2012 at 04:18 AM.

  2. #2
    Join Date
    Nov 2007
    Posts
    4

    Default

    I've found the solution. It's very simple. One have to use ModificationItems instead of removeAttributeValue().
    I think someone at springsource should consider registering this as a bug.

    So here is the solution:
    Code:
    ldapTemplate.modifyAttributes(groupDn, new ModificationItem[] {
    	new ModificationItem(
    		DirContext.REMOVE_ATTRIBUTE,
    		new BasicAttribute("member", personDn))
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •