Add users to LDAP using Java
Normally, you can use an LDAP tool such as JXplorer to add users. You also have the option of using Java to add and edit users.
To use this option, download AddEntryToLDAP.java. You can execute this file by doing either of the following:
-
Create a new project in Eclipse and execute it through the Eclipse user interface. You can configure the user in the script.
-
Compile and run the Java class through the Command Prompt.
If you choose to compile and run the Java class, follow these steps:
- Create a new folder.
- Copy the AddEntryToLDAP.java file to this folder.
- Open a Command Prompt window.
-
Set the path for the JDK in Windows. Locate your JDK installation path and enter the following command.
set path=%path%;C:\Program Files\Java\jdk1.8.0_60\bin
- Go to the folder containing the AddEntryToLDAP.java file.
-
Enter the following command to compile the .java file.
javac AddEntryToLDAP.java
-
Enter the following command to execute the compiled application.
java AddEntryToLDAP