Sunday 13 February 2011

ZCS global password reset.

Why, why ZCS has to keep practically EVERYTHING, except mailbox messages, in a LDAP directory. Which is implemented with quarter-of-century old Berkeley DB files. Why don't ZCS administrators implement at least a simple backup scheme. Why don't ZCS box owners   buy larger drives and let their mail system die of lack of disk space. Why is it always me who has to fix all the resulting mess.

But anyway, do you need a script to reset all your accounts to a temporary password and to impose change at next login? With ZCS, of course. Look no further.


#!/usr/local/bin/perl
while(<>)
{
$a = $_;
chop($a);
print "zmprov sp $a  YouTempPass\n";
print "zmprov ma $a zimbraPasswordMustChange TRUE\n";
}



Save to whatever.pl, then, as the zimbra user, do something like:

zmprov -l gaa your.mail.domain | perl whatever.pl | sh


Hee-hah!


No comments:

Post a Comment