I am trying to improve the performance so rather than making a separate call to AD through java LDAP SDK is there any way where I can just build one request where I can create the user, assign the attributes, add the members into security groups and distribution groups. and just fire one call and get it done. So can we do it using ldap SDK if yes can you guide me?
I think this is a limitation within Microsoft Active Directory. You can not add a user that does not exist to a group.
Some LDAP server implementations will allow this to take place by assuming the other entries will be created.
You could create separate functions which includes all of the items desired. As an example:
There is an example (done in JNDI) at: [https://github.com/jwilleke/Examples-JNDI/blob/master/src/com/willeke/samples/ldap/jndi/ADConnection.java]
Where something similar is performed.
-jim