Difference between revisions of "King0770-Notes-Lock-All-Accounts"

 
Line 14: Line 14:
 
<strong>OR</strong>
 
<strong>OR</strong>
 
<code><pre>
 
<code><pre>
perl -p -i -e 's/zimbraAccountStatus locked/zimbraAccountStatus locked/g' /tmp/usersLocked
+
perl -p -i -e 's/zimbraAccountStatus locked/zimbraAccountStatus active/g' /tmp/usersLocked
 
</pre></code>
 
</pre></code>
  

Latest revision as of 01:05, 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 active/g' /tmp/usersLocked


More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes

Jump to: navigation, search