Zimbra command

Restart:
zmcontrol stop
zmcontrol start

Show all account:
zmprov -l gaa

Show all admin account:
zmprov gaaa

Show all account with status, created date, last logon:
zmaccts

Show all user detail:
zmprov ga email@domain.com displayName description zimbraNotes zimbraCreateTimestamp zimbraLastLogonTimestamp

Show one user mailboxsize:
zmmailbox -z -m email@domain.com gms

Show all user mailboxsize:
#!/bin/bash

all_account="/opt/zimbra/bin/zmprov"
for account in $($all_account -l gaa | sort );

do
mb_size=`zmmailbox -z -m ${account} gms`;
echo "Mailbox size of ${account} = ${mb_size}";
done

Show all user detail:
#!/bin/bash

all_account="/opt/zimbra/bin/zmprov"

true > /tmp/userReport.txt

for account in $($all_account -l gaa | sort );

do
user_detail=`zmprov ga ${account} zimbraAccountStatus zimbraCreateTimestamp zimbraLastLogonTimestamp zimbraMailDeliveryAddress`;
mb_size=`zmmailbox -z -m ${account} gms`;
displayName=`zmprov ga ${account} displayName | grep displayName`;
description=`zmprov ga ${account} description | grep description`;
zimbraNotes=`zmprov ga ${account} zimbraNotes | grep zimbraNotes`;
zimbraPrefMailForwardingAddress=`zmprov ga ${account} zimbraPrefMailForwardingAddress | grep zimbraPrefMailForwardingAddress`;

echo "${user_detail}">>/tmp/userReport.txt;
echo "mailBoxSizeUsing: ${mb_size}">>/tmp/userReport.txt;
echo "${displayName}">>/tmp/userReport.txt;
echo "${description}">>/tmp/userReport.txt;
echo "${zimbraNotes}">>/tmp/userReport.txt;
echo "${zimbraPrefMailForwardingAddress}">>/tmp/userReport.txt;
echo >>/tmp/userReport.txt;

done

Comments

No comments yet. Why don’t you start the discussion?

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

*