Getting All Users Quota Data

Getting All User Quota Data With Zmsoap

   KB 21892        Last updated on 2016-06-20  

(0 votes)


Getting All User Quota Data With Zmsoap.


[zimbra@mail32 ~]$ zmsoap -z GetQuotaUsageRequest

<GetQuotaUsageResponse xmlns="urn:zimbraAdmin" more="0" searchTotal="6">
  <account limit="0" used="1775390" name="" id="fcdb6b46-f55a-4f60-8496-31e2e79f30d6"></account>
  <account used="9765" id="dc158043-4b02-4f85-9d8a-bf7446188117" limit="0" name=""></account>
  <account used="9146" name="" id="ec49fa30-3ed9-4574-baf1-ad9efae23637" limit="0"></account>
  <account name="" id="9c2d21ef-57ea-412d-b848-3853b67df2d8" used="0" limit="0"></account>
  <account used="0" limit="0" id="70f29afa-2a5e-4bd1-922e-4df090a45348" name=""></account>
  <account id="a3d19006-44e0-4a9d-9ccd-297a7a70489c" limit="0" used="0" name=""></account>

Getting All User Quota Data With Zmprov

To get quota stats, run. The output is a little bit difficult to read since it's in bytes:

zmprov gqu `zmhostname`

This will display in bytes- first column is usage, second column is max quota (0=unlimited), third column will be the account :

zmprov gqu `zmhostname`|awk {'print " "$3" "$2" "$1'}

Here's a script to put into user readable format below [by Tony P.]. You'll need to modify the $hostname variable near the top:


my $hostname = localhost;

my @quotas = `zmprov gqu $hostname`;

foreach my $quotaline(@quotas)



my ($email, $quota, $usage) = split(' ', $quotaline);



print "$email - $usage\n";


sub utils_convert_bytes_to_optimal_unit{

my($bytes) = @_;

return '' if $bytes eq '';

my $size;

$size = $bytes . ' Bytes' if $bytes < 1024;

$size = sprintf("%.2f", $bytes/1024) . ' KB' if $bytes >= 1024 && $bytes < 1048576;

$size = sprintf("%.2f", $bytes/1048576) . ' MB' if $bytes >= 1048576 && $bytes < 1073741824;

$size = sprintf("%.2f", $bytes/1073741824) . ' GB' if $bytes >= 1073741824 && $bytes < 1099511627776;

$size = sprintf("%.2f", $bytes/1099511627776) . ' TB' if $bytes >= 1099511627776;

return $size;


Additional Content

  • See the soap-admin.txt file in /opt/zimbra/docs/ and also Zmsoap for more zmsoap examples.
Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 04/26/2015
Article ID: Date Modified: 2016-06-20

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 SME1 SME2 Copyeditor Last edit by Jorge de la Cruz
Jump to: navigation, search