User Reports

Revision as of 17:28, 24 March 2015 by Jorge de la Cruz (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Admin Article

Article Information

This article applies to the following ZCS versions.

ZCS 4.5 Article ZCS 4.5

Zimbra doesn't seem to have good ways of counting users by COS or domains. I've written a couple of scripts to make that easier. Be warned that these can take a long time to run if you have a lot of users


The following script will generate a report of total users in each COS. This may be useful for Zimbra customers who are billed based on accounts with different feature levels:

#!/bin/sh

tmpfile=`mktemp`
account_list=`zmprov gaa`

for cos_name in `zmprov gac` ; do
        cos_id=`zmprov gc $cos_name | grep zimbraId | cut -f2 -d\ `
        cos_count=0
        for account in $account_list ; do
                account_cos_id=`zmprov ga $account | grep $cos_id | cut -f2 -d\ `
                if [ "$account_cos_id" = "$cos_id" ] ; then
                        let cos_count=cos_count+1
                fi
        done
        echo "$cos_name has $cos_count accounts." >> $tmpfile
done

cat $tmpfile
rm -f $tmpfile
Verified Against: ZCS 4.5 Date Created: 12/8/2006
Article ID: https://wiki.zimbra.com/index.php?title=User_Reports Date Modified: 2015-03-24



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 »

Jump to: navigation, search