A easy to configure and use go application which can be used as a command line interface to execute CRUD operations on a LDAP server.
The go-ldap package is copied over to this repository so that the CLI can be built and executed from a close environment.
This package is a dependency of the go-ladp package. This package is copied over to this repository so that the CLI can be built and executed from a close environment.
- Add a user
- Delete a Users
- Add a group
- Delete a group
- Add a members to a group
- Remove a members from a group
- User and Group validations while performing the above operations
- Easy configuration
Basic configuration details for the LDAP connection and based DN can be set in the ldap-connection.json file. This file is placed in the conf directory.
connections file format:
{
"hostname": "192.168.178.2",
"port": "10389",
"bindUser": "cn=root,dc=privatesquare,dc=in",
"baseDN": "dc=privatesquare,dc=in",
"userBaseDN": "ou=users,dc=privatesquare,dc=in",
"groupBaseDN": "ou=groups,dc=privatesquare,dc=in"
}
Usage of ./ldap-cli:
-addGroup
Add a Group. Required parameter: cn, ou. Optional parameter: memberId
-addMembers
Add a member to a group. Required Parameter: cn, ou, memberId
-addUser
Add a user. Required parameters: uid,cn,sn mail, password
-bindPassword string
LDAP bind password.
-cn string
Name
-connConfigFile string
Connection details of the LDAP server. (default "./conf/ldap-connection.json")
-deleteGroup
Delete a Group. Required Parameter: cn, ou
-deleteUser
Deletes a user. Required parameter: uid
-mail string
Email ID
-memberIds string
Id of a user to be added to a group. Pass comma separated values if you wish to add more than one member
-ou string
Organizational Unit
-password string
User Password
-removeMembers
Remove a member to a group. Required Parameter: cn, ou, memberId
-sn string
Last Name
-uid string
User ID
Examples for running the cli can be found in the scripts directory.