Quote:
Originally Posted by rcaudill Hi there,
I am just wondering if any one here has modified accounts via Zimbra LDAP? Also, theoretically could one create an account using LDAP? Basically I am trying to use django_ldapdb to create accounts. We use a lot of python code and there really isn't a good soap api connector so I figured this would be another way? |
I'm using LDAP search for reading accounts preferences and using LDIF file for modify the entry.
Below are an example of LDAPSearch :
Code:
displayName=`/opt/zimbra/bin/ldapsearch -H $LDAP_MASTER_URL -w $ZIMBRA_LDAP_PASSWORD -D uid=zimbra,cn=admins,cn=zimbra -x $OBJECT | grep displayName: | cut -d ':' -f2
Modify script :
Code:
ldapmodify -f "$CURRENT_FOLDER/zcs-acc-mod.ldif" -x -H ldapi:/// -D cn=config -w $ZIMBRA_LDAP_PASSWORD
Sample of zcs-acc-mod.ldif contents :
Code:
mail:/home/vavai # cat zcs-acc-mod.ldif
dn: uid=vivian.chow,ou=people,dc=mydomain,dc=co,dc=id
changetype: modify
replace: userPassword
userPassword:: e1NTSEF9SU5BbzZjYjhYMSMnaU1hOGRURkdOWjg4L1VpMHMyTHI=
I never create an account using Zimbra LDAP with coding but you should be able calling zmprov CLI from your code and populate it with your new account parameter.