Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-09-2007, 09:05 AM
Active Member
 
Posts: 28
Lightbulb [SOLVED] Listing Distribution List Members

We have been using the distribution lists feature via the Admin UI for a while now, and we keep finding more and more uses for them. The only problem that we have come across (caused by us) is that we need to periodically audit the members of each distribution list. We do this to make sure that all required users are on each list, and that no one is on a list that they shouldn't be.

I did not see anything already available that did this so I put together a real basic LDAP query to accomplish this task. I figured that if I needed to do this someone else would also, so here is the basic query to list the members of all distribution lists:

Code:
ldapsearch -x -v -H 'ldap://localhost/' -b 'ou=people,dc=mydomain,dc=com' "objectClass=zimbraDistributionList" mail zimbraMailForwardingAddress
If you only want to list a single distribution list you can run the query as follows:

Code:
ldapsearch -x -v -H 'ldap://localhost/' -b 'uid=distributionlistname,ou=people,dc=mydomain,dc=com' "objectClass=zimbraDistributionList" mail zimbraMailForwardingAddress
These commands need to be run as the zimbra user. Also, make sure you replace these strings:
mydomain - should be your domain name
distributionlistname - should be the name of the distribution list you are trying to list
Hopefully, someone else will get some use out of this.

RobertJ
Reply With Quote
  #2 (permalink)  
Old 10-09-2007, 09:49 AM
Zimbra Consultant
 
Posts: 5,814
Default

Simpler would be to :
su zimbra
zmprov gdl list@domain.com

If you forget the list names:
zmprov gadl (or zmprov gadl domain.com)
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Reply With Quote
  #3 (permalink)  
Old 10-09-2007, 10:24 AM
Special Member
 
Posts: 115
Default

Funny enough I prefer the ldap search query over the zmprov's method since usually the people who ask for such information do not need to know all the information the it provides.

Code:
zmprov gadl > /tmp/distlist.tmp
for list in `cat /tmp/distlist.tmp`; do  
zmprov gdl $list > /home/zimbra/temp/$list; 
done
Which will give you a directory full of text files for each distribution list.

Which I might now modify with the ldap queries.
__________________
Because we all can't be geniuses, I'll go first.
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0