For a single user:
Code:
su - zimbra
cd /tmp
source ~/bin/zmshutil ; zmsetvars
ldapsearch -x -H ldap://$ldap_host -D "$zimbra_ldap_userdn" -w "$zimbra_ldap_password" "(mail=user@mydomain.com)" | sed -e '/# search result/,$ d' > user.ldif
Change:
user@mydomain.com to the user for whom you want the ldif
user.ldif to whatever_you_want.ldif
If you want all users in a single ldif, replace the ldapsearch command above with
Code:
ldapsearch -x -H ldap://$ldap_host -D "$zimbra_ldap_userdn" -w "$zimbra_ldap_password" | sed -e '/# search result/,$ d' > user.ldif
i.e. remove the "(mail=user@mydomain.com)" filter.