====== Mémo commandes Zimbra ======
===== Afficher la configuration d'un domaine =====
sudo -u zimbra /opt/zimbra/bin/zmprov gd fws.fr
===== Configurer l'adresse de l'interface d'admin pour un domaine =====
sudo -u zimbra /opt/zimbra/bin/zmprov md fws.fr zimbraWebClientAdminReference https://zma.fws.fr/
===== Configurer l'adresse de l'interface web pour un domaine =====
sudo -u zimbra /opt/zimbra/bin/zmprov md fws.fr zimbraPublicServiceHostname zm.fws.fr
===== Configurer l'auth AD / LDAP =====
DOMAIN=fws.fr
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthLdapBindDn '%u@fws.fr'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthLdapSearchFilter '(&(objectClass=user)(memberOf:1.2.840.113556.1.4.1941:=CN=Role_Mail,OU=Roles,DC=fws,DC=fr)(samAccountName=%u))'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthLdapSearchBindDn 'CN=Zimbra,OU=Apps,DC=fws,DC=fr'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthLdapSearchBindPassword 'LdapPassw0rd'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthLdapURL 'ldaps://dc1.fws.fr:3269 ldaps://dc2.fws.fr:3269'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraExternalGroupLdapSearchBase 'OU=Groups,DC=fws,DC=fr'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraExternalGroupLdapSearchFilter '(objectClass=group)'
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthMech ad
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAuthMechAdmin ad
===== Configurer le provisionning AD / LDAP =====
DOMAIN=fws.fr
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvAccountNameMap "samAccountName"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN +zimbraAutoProvAttrMap description=description
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN +zimbraAutoProvAttrMap displayName=displayName
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN +zimbraAutoProvAttrMap givenName=givenName
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN +zimbraAutoProvAttrMap cn=cn
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN +zimbraAutoProvAttrMap sn=sn
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvAuthMech LDAP
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvBatchSize 50
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapAdminBindDn "CN=Zimbra,OU=Apps,DC=fws,DC=fr"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapAdminBindPassword "Sup3rSecrETP4ssPhr@se"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapBindDn "zimbra@fws.fr"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapSearchBase "OU=People,DC=fws,DC=fr"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapSearchFilter "(&(cn=%u)(objectClass=user)(memberOf:1.2.840.113556.1.4.1941:=CN=Role_Mail,OU=Roles,DC=fws,DC=fr)(mail=*))"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapURL "ldap://dc.fws.fr:389"
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvLdapStartTlsEnabled TRUE
sudo -u zimbra /opt/zimbra/bin/zmprov md $DOMAIN zimbraAutoProvMode EAGER
sudo -u zimbra /opt/zimbra/bin/zmprov ms $(sudo -u zimbra /opt/zimbra/bin/zmhostname) zimbraAutoProvPollingInterval "10m"
sudo -u zimbra /opt/zimbra/bin/zmprov ms $(sudo -u zimbra /opt/zimbra/bin/zmhostname) +zimbraAutoProvScheduledDomains "$DOMAIN"