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 12-10-2008, 03:47 AM
Elite Member
 
Posts: 314
Default [SOLVED] how to export account details ?

Hi,

I am using zcs-4.5.10 on RHEL 5. and this setup is running with 2 different domains. Now our management required all email accounts details of both domains. SO is there any way by which we can export all email id details from zimbra admin console ??
Reply With Quote
  #2 (permalink)  
Old 12-10-2008, 03:54 AM
Zimbra Consultant & Moderator
 
Posts: 11,512
Default

You'll have to script it and use the command line (and search the forums for details and wiki) to export account details:

Code:
zmprov help commands
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 03-13-2009, 12:57 AM
Elite Member
 
Posts: 314
Default

hi,
how can i export details for specific domain ?

I used " zmprov gqu <server name> " command but it is using account details for all domains.

Pls help.

Thanks..
Reply With Quote
  #4 (permalink)  
Old 03-13-2009, 01:23 AM
Moderator
 
Posts: 5,806
Default

Code:
su - zimbra
zmprov gaa {domain}
will list the mailboxes for a particular domain. Are there specific details you are trying to obtain ?
__________________
SplatNIX IT Services :: Innovation through Collaboration™


http://www.messagefortress.com
Reply With Quote
  #5 (permalink)  
Old 03-13-2009, 01:32 AM
Elite Member
 
Posts: 314
Default

hey thanks for quick response. actually i just wanted all email ID details and by this command i got id.
But for my reference i want alloted mailbox size and used mailbox size of every account. so how to use zmprov for that to specific domain ?
Reply With Quote
  #6 (permalink)  
Old 03-13-2009, 01:48 AM
Moderator
 
Posts: 5,806
Default

Something along these lines would do what you want.
Code:
su - zimbra

#!/bin/bash

echo "Account            MailQuota                   QuotaUsed"
zmprov gaa {whateverdomain} | while read ACCOUNT
do
    QUOTA=`zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | awk -F\: '{ print $2 }'`
    USAGE=`zmmailbox -z -m ${ACCOUNT} gms`
    echo "${ACCOUNT}          ${QUOTA}                   ${USAGE}"
done
__________________
SplatNIX IT Services :: Innovation through Collaboration™


http://www.messagefortress.com
Reply With Quote
  #7 (permalink)  
Old 03-13-2009, 02:41 AM
Elite Member
 
Posts: 314
Default

Hey thank u so much...i got that output which i wanted
Now i m trying to put it in excel ..
thanks again..
Reply With Quote
  #8 (permalink)  
Old 03-13-2009, 02:48 AM
Moderator
 
Posts: 5,806
Default

Code:
#!/bin/bash

echo "Account,MailQuota,QuotaUsed"
zmprov gaa {whateverdomain} | while read ACCOUNT
do
    QUOTA=`zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | awk -F\: '{ print $2 }'`
    USAGE=`zmmailbox -z -m ${ACCOUNT} gms`
    echo "${ACCOUNT},${QUOTA},${USAGE}"
done > accounts.csv
Job done
__________________
SplatNIX IT Services :: Innovation through Collaboration™


http://www.messagefortress.com
Reply With Quote
  #9 (permalink)  
Old 03-13-2009, 04:11 AM
Elite Member
 
Posts: 314
Default

Hi uxbod..thanks for all tricks ...i did below changes and now i am getting very useful output in excel...

#!/bin/bash
rm -fr /root/test.xls
echo "Account MailQuota QuotaUsed AccountStaus">>/root/test.xls
/opt/zimbra/bin/zmprov gaa example.com | while read ACCOUNT
do
QUOTA=`/opt/zimbra/bin/zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | awk -F\: '{ print $2 }'`
QUOTA=`expr ${QUOTA} / 1024`
QUOTA=`expr ${QUOTA} / 1024`
QUOTA="${QUOTA}MB"
USAGE=`/opt/zimbra/bin/zmmailbox -z -m ${ACCOUNT} gms`
AS=`/opt/zimbra/bin/zmprov ga ${ACCOUNT} | grep zimbraAccountStatus |awk -F\: '{ print $2 }'`


echo "${ACCOUNT} ${QUOTA} ${USAGE} ${AS}">>/root/test.xls
done



and now I am getting below output in excel


Account MailQuota QuotaUsed AccountStatus





thank u so much for ur quick support ....

Last edited by chandu : 03-13-2009 at 04:24 AM.
Reply With Quote
  #10 (permalink)  
Old 03-13-2009, 04:12 AM
Moderator
 
Posts: 5,806
Default

Great ... Glad you are getting the report you required
__________________
SplatNIX IT Services :: Innovation through Collaboration™


http://www.messagefortress.com
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