Results 1 to 3 of 3

Thread: Distribution List Update Script

  1. #1
    physikal is offline Loyal Member
    Join Date
    Apr 2009
    Posts
    90
    Rep Power
    6

    Default Distribution List Update Script

    I am using the following script to update one of our lists:

    Code:
    # get all accounts and
    # assume you want to remove several system accounts first
    # and don't forget to SORT it first
    zmprov gaa | sed /admin/d | sed /wiki/d | sed /spam./d | sed /ham./d |
    sort > account.txt
    # if you are search all users who belongs to specific COS,
    # then uncomment these lines.
    # and cos_id can be found by zmprov gc <cos_name> | grep  "zimbraId:"
    # zmprov sa zimbraCOSId=<cos_id> > account.txt
    
    
    
    # get all members of your distribution list, e.g. all@example.com
    # again, SORT it first
    zmprov gdl dl_compnay_all@compnay.com | grep "zimbraMailForwardingAddress" | cut -d' ' -f2 | sort > member.txt
    
    # compare and get the difference
    comm -2 -3 account.txt member.txt > add.txt
    comm -1 -3 account.txt member.txt > del.txt
    
    # add new member
    cat add.txt |
    while read line; do
      echo "add new member : $line"
      zmprov adlm dl_compnay_all@compnay.com $line
    done
    
    # and this is to remove
    cat del.txt |
    while read line; do
      echo "remove member : $line"
      zmprov rdlm dl_compnay_all@compnay.com $line
    done
    For some reason it continues to miss specific accounts, only about 5-10 out of 220. Always the same accounts. These accounts look exactly the same as accounts that are added successfully, I have no idea why it would be doing this.

    Any ideas? When I run zmprov gaa it accounts show up there as well, so I would think they would be added to one of the txt files this script spits out, but its not anywhere on them. The accounts don't show up in the add/member/del txts either. It is very odd.

  2. #2
    Fox_sibirsky is offline Active Member
    Join Date
    Sep 2009
    Location
    Russia, Novosibirsk
    Posts
    31
    Rep Power
    5

    Default

    I use this command to add user in distribution
    zmprov adlm listname@ntk.novotelecom.ru member@ntk.novotelecom.ru

  3. #3
    physikal is offline Loyal Member
    Join Date
    Apr 2009
    Posts
    90
    Rep Power
    6

    Default

    Figured it out. Thanks!
    Last edited by physikal; 10-22-2009 at 03:08 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Listing Distribution List Members
    By rwjblue in forum Administrators
    Replies: 8
    Last Post: 05-06-2014, 09:20 PM
  2. [SOLVED] Sudden problem synching with gmail
    By bouchardpie in forum Error Reports
    Replies: 8
    Last Post: 09-09-2010, 09:50 AM
  3. Problem syncing all folders
    By mark_the_chain in forum Error Reports
    Replies: 0
    Last Post: 11-23-2008, 04:59 PM
  4. Replies: 4
    Last Post: 01-29-2008, 08:43 PM
  5. Orphaned alias for a distribution list
    By area in forum Administrators
    Replies: 0
    Last Post: 09-17-2006, 08:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •