Powered by Blogger.

Zimbra Tips : How To Reset To COS Value (Class Of Service)

After set COS for all users as described on previous article, overall the value/features on COS has been rewrite for all users. However, i am still get default value for some users such as quotas. Quotas for some users still using default value (unlimited). if checked via Zimbra Admin | Manage | Account | right click and select edit for account which still using default value on quota, i get the following information
I could click Reset to COS value and automatically value of quota using COS rule. For some users such as 3-5 users, maybe i can do it manually via Zimbra admin. But if a lot of users who have the same value on quotas, manually process is need more time until done. I am decided to using Zimbra Command Line for the shorter time. The following is example command for reset value of quotas to COS rule.
1.zmprov ma admin@example.com zimbraMailQuota ""
Note : The above command will enforce admin@example.com for using zimbraMailQuota on COS rule. For enforce all users to using COS value, you could make a script as below
1.vi /srv/reset-to-cos.sh
Fill with the following line
04.rm /srv/reset-to-cos.zmp
05.echo "Retrieve zimbra user name..."
07.USERS=`su - zimbra -c 'zmprov -l gaa | sort'`;
09.for ACCOUNT in $USERS; do
10.echo "Enforce COS value for account $ACCOUNT"
11.echo "ma $ACCOUNT zimbraMailQuota ''" >> /srv/reset-to-cos.zmp
Give execute access and run the above script
1.chmod +x /srv/reset-to-cos.sh
2.sh /srv/reset-to-cos.sh
The result of the above script is file with name reset-to-cos.zmp which is located in /srv/ folder. Execute it file with the following command as user Zimbra
1.su - zimbra
2.zmprov < /srv/reset-to-cos.zmp
If you want to reset to COS value for another attribute, you could change zimbraMailQuota with other attribute/parameters.
Good luck and hopefully useful 😀
    Blogger Comment
    Facebook Comment