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 edit summary
Line 5: Line 5:
<strong>But WHY?</strong><br>
<strong>But WHY?</strong><br>
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 <strong>mailbox_id</strong>, and this would <strong>NOT</strong> be good. Preventing users from authenticating minimizes risk; especially if you have to start up a new mysql instance.
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 <strong>mailbox_id</strong>, and this would <strong>NOT</strong> be good. Preventing users from authenticating minimizes risk; especially if you have to start up a new mysql instance.
<br>
<br>
<br>
<strong>To Unlock</strong><br>
<strong>To Unlock</strong><br>

Revision as of 00:56, 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

Jump to: navigation, search