Populate users in LDAP through JAVA

D

Deepak Nayal

Hi All

I am trying to populate my Active Directory Server with around 1000
groups with 900 users each, using a JAVA program that uses netscape SDK
to connect to the ADS. I am using the netscape directory SDK. The
following is my program code :-

================================================================
import netscape.ldap.*;

public class First {

public static void main(String[] args) throws Exception{
String HOST = "172.16.55.90";
int PORT = 389;
String DN = "cn=Users,DC=BEAADS, DC=beahcl, DC=com";
String PRI = "cn=Administrator,cn=Users,DC=BEAADS,DC=beahcl,DC=com";
LDAPConnection ld = new LDAPConnection();
ld.connect( HOST, PORT, PRI, "admin");
System.out.println("+-+-+-+-Connected-+-+-+-+");
LDAPEntry myEntry = new
LDAPEntry("cn=ndeepak,cn=Users,DC=BEAADS,DC=beahcl,DC=com");
ld.add(myEntry);
System.out.println("GREAT !!!");

ld.disconnect();
}
}
================================================================

But this program gives the following output :-
================================================================
+-+-+-+-Connected-+-+-+-+
netscape.ldap.LDAPException: error result (65); 0000207B: UpdErr:
DSID-03050C19, problem 6002 (OBJ_CLASS_VIOLATION), data 0; Object class
violation
at netscape.ldap.LDAPConnection.checkMsg(LDAPConnection.java:4852)
at netscape.ldap.LDAPConnection.add(LDAPConnection.java:2833)
at netscape.ldap.LDAPConnection.add(LDAPConnection.java:2848)
at netscape.ldap.LDAPConnection.add(LDAPConnection.java:2798)
at First.main(First.java:44)
Exception in thread "main"
================================================================

Can anybody please let me know what am I doing wrong here ?

Regards
Deepak Nayal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top