Jump to content

GetAllDLUsers

From TetraWiki


Zimbra Script to get all users email from all DLs[edit]

Step1 :- Create all the files (like file,file2 etc.. ) given below in the script[edit]

Note:--- First get all the DLs (Distributed List) using the below cammand :-

  1. zmprov -gadl > /tmp/alldl
  1. touch /tmp/file2
  1. vim /tmp/dlgetuser.sh
  1. !/bin/bash

file=/tmp/alldl file2=/tmp/allmem zmprov gadl > $file

for i in `cat $file`

do

echo $i >> $file2 zmprov gdl $i | grep "zimbraMailForwardingAddress:" | awk {'print $2'} >> $file2 echo " " >> $file2 printf "\n" >> $file2 done

wq!

Step2:- Then run the script[edit]

  1. sh -x /tmp/dlgetuser.sh