Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [SOLVED] how to export account details ?

  1. #1
    chandu is offline Elite Member
    Join Date
    Dec 2007
    Posts
    445
    Rep Power
    7

    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 ??

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,569
    Rep Power
    57

    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


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    chandu is offline Elite Member
    Join Date
    Dec 2007
    Posts
    445
    Rep Power
    7

    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..

  4. #4
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Code:
    su - zimbra
    zmprov gaa {domain}
    will list the mailboxes for a particular domain. Are there specific details you are trying to obtain ?

  5. #5
    chandu is offline Elite Member
    Join Date
    Dec 2007
    Posts
    445
    Rep Power
    7

    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 ?

  6. #6
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    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

  7. #7
    chandu is offline Elite Member
    Join Date
    Dec 2007
    Posts
    445
    Rep Power
    7

    Default

    Hey thank u so much...i got that output which i wanted
    Now i m trying to put it in excel ..
    thanks again..

  8. #8
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    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

  9. #9
    chandu is offline Elite Member
    Join Date
    Dec 2007
    Posts
    445
    Rep Power
    7

    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 03:24 AM.

  10. #10
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Great ... Glad you are getting the report you required

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] my server stopped working???
    By cecil in forum Administrators
    Replies: 4
    Last Post: 04-20-2008, 08:07 AM
  2. installation error during ldap setup
    By ljramos in forum Installation
    Replies: 23
    Last Post: 08-10-2007, 10:48 PM
  3. unable to restart zimbra after reboot
    By droefs in forum Administrators
    Replies: 28
    Last Post: 04-16-2006, 02:33 PM
  4. Replies: 16
    Last Post: 01-05-2006, 09:55 AM
  5. After Succesfull Install, Cannot Start mta
    By bsimzer in forum Installation
    Replies: 26
    Last Post: 12-16-2005, 05:45 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
  •