hi,
It is very easy to update ldap entry using a shell script.
function update_user_ldif {
user_name=$1
cat > $UPDATE_USER <<- TEMPLATE_LDIF
dn: uid=$user_name,ou=users,dc=aganith,dc=com
changetype: modify
replace: employeeType
employeeType: $emp_type
TEMPLATE_LDIF
}
ldapmodify -h $LDAP_HOST -w $LDAP_ROOT_PASSWD -D $ROOT_BIND_DN -x -f $UPDATE_USER
* LDAP_HOST :- ldap server ip
* LDAP_ROOT_PASSWD :- ldap access password
* ROOT_BIND_DN :- account used for admin access. eg: cn=admin,dc=aganith,dc=com
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment