Show Closed accounts with their Quota and Used Space
Show Closed accounts with their Quota and Used Space
- This article is a Work in Progress, and may be unfinished or missing sections.
Purpose
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.
Resolution
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 closed-accounts.sh
Paste then inside the next code
#!/bin/bash echo "Username Total Quota Usage Server Last Login Time" zmaccts | grep closed | grep @ | awk '{ print $1 }' | while read ACCOUNT do 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 }' ` echo "${ACCOUNT} ${QUOTA_TOTAL} ${QUOTA_USAGE} ${HOSTED_ON} ${LAST_ON} " done
Then make it executable
chmod +x
Now can execute the script and will look like
zimbra@zimbra-sn-u14-10:/tmp$ ./script.sh Username Total Quota Usage Server Last Login Time user@example.com 524288000 13.13 MB mail.example.com 20141127210335Z
Additional Content
- Not related content