[How To]: Reset bulk passwords for users in Zimbra

[How To]: Reset bulk passwords for users in Zimbra

 

How to Reset password for all (any) users in Zimbra.



Login to Zimbra SSH.


updatedb && locate zmprov
In most cases it the location for the bin file of zmprov will be at /opt/zimbra/bin/zmprov

Now Fetch Users from the Zimbra Backend.

                                                      
 /opt/zimbra/bin/zmprov -l gaa [domain name] > /tmp/allzimbrauserforpasschange.txt



If you don't mention domain name then it will fetch all zimbra users of the server.


Open 
 /tmp/allzimbrauserforpasschange.txt and remove any user whose password reset is not needed, also remove default zimbra users like galsync, abuse, spam etc.

Once you're ready with the list of users run below for loop in screen.

for i in `cat /tmp/allzimbrauserforpasschange.txt` ; do newpass="S@wE#224`openssl rand -base64 12`0a" && /opt/zimbra/bin/zmprov sp $i $newpass && echo $i  $newpass  >> newlogin.txt &&  echo $i && sleep 5s ; done

You'll got the master file with all logins in PWD named  newlogin.txt and copy data to secure location and remove that.      



PS. If load spike, edit the for loop's sleep section to 90s, it will slow down the speed of loop and will not break. 

 


    • Related Articles

    • [How to] Reset VirtualMin ftp password

      Reset VirtualMin ftp password Login to the VirtualMin dashboard: on https://server_ip_or_dns_name:10000 Login using the root login. From the VirtualMin Dash drop down on left hand side, select the domain. Edit Virtual Server > Configurable settings ...
    • How To Edit Hosts File (Local Point) In Linux, Windows, Or Mac

      Introduction The hosts file in Windows, Mac, or Linux maps hostnames to IP addresses. For example, an intranet, like a corporate office that has servers for users to access, or it could be domain names for servers on the internet. Editing your hosts ...