King0770-Notes-Lock-All-Accounts: Difference between revisions
(Created page with "Whenever I am in a recovery (or maintenance) situation, one of my first tasks is to lock all accounts.<br> <code><pre> zmprov -l gaa | awk '{ print "ma"" "$1" ""zimbraAccountS...") |
(No difference)
|
Revision as of 00:55, 24 April 2019
Whenever I am in a recovery (or maintenance) situation, one of my first tasks is to lock all accounts.
zmprov -l gaa | awk '{ print "ma"" "$1" ""zimbraAccountStatus locked" }' >> /tmp/usersLocked; zmprov < /tmp/usersLocked
But WHY?
One of the biggest reasons, at least for me, is if I have to move aside the mysql data, and if the accounts are not locked, and if the user authenticates into their account, they could potentially get assigned a new mailbox_id, and this would NOT be good. Preventing users from authenticating minimizes risk; especially if you have to start up a new mysql instance.
To Unlock
You can do:
zmprov -l gaa | awk '{ print "ma"" "$1" ""zimbraAccountStatus active" }' >> /tmp/usersUnlock; zmprov < /tmp/usersUnlock
OR
perl -p -i -e 's/zimbraAccountStatus locked/zimbraAccountStatus locked/g' /tmp/usersLocked
More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes