Show Closed accounts with their Quota and Used Space

Show Closed accounts with their Quota and Used Space

   KB 21750        Last updated on 2015-07-12  

(0 votes)


This simple Script lists out all the Closed accounts and what their quota is and what is used and the last time it was accessed, and what server the mail was hosted on.


First step is create the Script file, in this example will be under the /tmp folder, but choose the path that you prefer.

cd /tmp vi

Paste then inside the next code

echo "Username Total Quota Usage Server Last Login Time"
zmaccts | grep closed | grep @ | awk '{ print $1 }' | while read ACCOUNT
QUOTA_TOTAL=`zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | cut -d ":" -f2`
QUOTA_USAGE=`zmmailbox -z -m ${ACCOUNT} gms`
HOSTED_ON=`zmprov ga ${ACCOUNT} | grep zimbraMailHost | awk -F: '{ print $2 }'`
LAST_ON=`zmprov ga ${ACCOUNT} | grep zimbraLastLogonTimestamp: | awk -F: '{ print $2 }' `

Then make it executable

chmod +x

Now can execute the script and will look like

zimbra@zimbra-sn-u14-10:/tmp$ ./
Username Total Quota Usage Server Last Login Time  524288000 13.13 MB  20141127210335Z

Additional Content

  • Not related content

Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 03/19/2015
Article ID: Date Modified: 2015-07-12

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Wiki/KB reviewed by Jorge SME 2 Copyeditor Last edit by Jorge de la Cruz
Jump to: navigation, search