How to Get, Add, Delete, Distribution List using zmprov CLI in Zimbra

zimbraThe zmprov tool can performs all provisioning tasks in Zimbra LDAP including creating accounts, aliases, domains, COS, distribution lists, and calendar resources.This zmprov is very powerful tool for zimbra administrator to perform daily task. Beside using command line interface (CLI), system administrator also can perform the following task from zimbra admin console. For CLI, the syntax is zmprov [cmd] [argument].

1. Login to zimbra :

[root@centos64 ~]# su - zimbra

2. How to get DistributionListmembership :

[zimbra@centos64 ~]$ zmprov gdlm ictgroup@ehowstuff.local
# distributionList ictgroup@ehowstuff.local memberCount=2

members
admin@ehowstuff.local
user1@ehowstuff.local

3. How to getDistributionList :

[zimbra@centos64 ~]$ zmprov gdl ictgroup@ehowstuff.local
# distributionList ictgroup@ehowstuff.local memberCount=2
mail: ictgroup@ehowstuff.local
objectClass: zimbraDistributionList
objectClass: zimbraMailRecipient
uid: ictgroup
zimbraCreateTimestamp: 20130512043842Z
zimbraId: ee8b2755-d450-42a0-bb8b-b0ab64901ca6
zimbraMailAlias: ictgroup@ehowstuff.local
zimbraMailForwardingAddress: admin@ehowstuff.local
zimbraMailForwardingAddress: user1@ehowstuff.local
zimbraMailHost: centos64.ehowstuff.local
zimbraMailStatus: enabled

members
admin@ehowstuff.local
user1@ehowstuff.local

4. How to createDistributionList :

[zimbra@centos64 ~]$ zmprov cdl newgroup@ehowstuff.local
94bf7dad-3f01-4c5c-a02a-bc646cd1c4b7
[zimbra@centos64 ~]$ zmprov adlm newgroup@ehowstuff.local user1@ehowstuff.local
[zimbra@centos64 ~]$ zmprov adlm newgroup@ehowstuff.local user2@ehowstuff.local
[zimbra@centos64 ~]$ zmprov gdlm newgroup@ehowstuff.local
# distributionList newgroup@ehowstuff.local memberCount=2

members
user1@ehowstuff.local
user2@ehowstuff.local

5. How to removeDistributionListMember :

[zimbra@centos64 ~]$ zmprov rdlm newgroup@ehowstuff.local user2@ehowstuff.local

6. How to getAlldistributionLists :

[zimbra@centos64 ~]$ zmprov gadl
ictgroup@ehowstuff.local
newgroup@ehowstuff.local
2 comments
  1. dgp
    dgp
    January 7, 2015 at 11:15 am

    how to add owner of distribution list ?

    Reply
  2. An
    An
    August 18, 2016 at 6:59 pm

    You can add it as below:
    zmprov mdl list@domain zimbraACE “id – account usr ownDistList”

    Cheer!

    Reply
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee