Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 190499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:15:41+00:00 2026-05-11T16:15:41+00:00

I am trying to add a group to a different group in Active Directory

  • 0

I am trying to add a group to a different group in Active Directory using a JNDI program. On doing so, I get the following error

[LDAP: error code 53 – 00002142:
SvcErr: DSID-031A0FC0, problem 5003
(WILL_NOT_PERFORM), data 0

The code snippet I am using is below

  1. Setting Group Attributes

Attributes attrs = new BasicAttributes(true);
attrs.put("objectClass","group")
attrs.put("description","A test group");

  1. Adding group to different group

try{
    ModificationItem member[] = new ModificationItem[1];
    member[0]= new ModificationItem(DirContext.ADD_ATTRIBUTE, new BasicAttribute("member", groupDN)); 

ctx.modifyAttributes(grpDN,member);
 System.out.println("Added group to group: " + grpDN);

}catch (NamingException e) {
System.err.println("Problem adding group to group: " + e);
}

I am able to add User to groups using almost the same type of code (below).

  1. Setting User Attributes

// Create attributes to be associated with the new user
Attributes attrs = new BasicAttributes(true); 
attrs.put("objectClass","user");
attrs.put("samAccountName","Perry");
attrs.put("cn","Perry");

attrs.put("givenName","Perry"); attrs.put("sn","Perry"); attrs.put("displayName","Perry Peterson"); attrs.put("description","Research Engineer");

int UF_ACCOUNTDISABLE = 0x0002; int UF_PASSWD_NOTREQD = 0x0020; int UF_PASSWD_CANT_CHANGE = 0x0040; int UF_NORMAL_ACCOUNT = 0x0200; int UF_DONT_EXPIRE_PASSWD = 0x10000; int UF_PASSWORD_EXPIRED = 0x800000;

attrs.put("userAccountControl",Integer.toString(UF_NORMAL_ACCOUNT + UF_PASSWD_NOTREQD + UF_PASSWORD_EXPIRED+ UF_ACCOUNTDISABLE));

  1. Adding User to Groups

try{
    ModificationItem member[] = new ModificationItem[1];
    member[0]= new ModificationItem(DirContext.ADD_ATTRIBUTE, new BasicAttribute("member", userDN)); 

ctx.modifyAttributes(groupDN,member);
System.out.println("Added user to group: " + groupName);
}catch (NamingException e){
    System.err.println("Problem adding user to group: " + e);

}

Does any one has idea about what I am doing wrong here or is there any attribute that has to be set for groups also as in the case of Users. I have a SSL connection between my JNDI client and the server and I am able to successfully reset User password (that will not be possible if SSL is not there)

I suspect this is happening because the group I have created earlier are not created properly

Regards

Perry

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:15:42+00:00Added an answer on May 11, 2026 at 4:15 pm

    This is happening as the Groups are created as Security Groups by default and it is not possible to add Groups to Groups (in case of Security Groups)

    If you want to have nested groups, create groups as universal distribution and then only you will be able to add groups to groups

    This behavior is for Active Directory. I am not aware of Other directories.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add a group to a mailbox (in C#). I'm using a
Im trying to add a tag to a group so when I want to
Trying to add a class object into a List using reflection, but when invoking
Im trying to add a directory foo to my repo, but there are some
I'm trying to add a group of four radio buttons to a form. There
Ok so i'm trying to pull a user from active directory into a DirectoryUser
I am trying to add a new radio button to an existing group box
I'm trying to get ERB templates 'working' in Emacs 22 and 23 (two different
I am trying to add a group of markers to google maps each with
I'm trying to get some aggregate values from different tables, but my problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.