Skip to content

Instantly share code, notes, and snippets.

@Mostafa-Hamdy-Elgiar
Created February 25, 2017 08:28
Show Gist options
  • Save Mostafa-Hamdy-Elgiar/f3ccbb4b0b5ffb492b892846f6c244d9 to your computer and use it in GitHub Desktop.
Save Mostafa-Hamdy-Elgiar/f3ccbb4b0b5ffb492b892846f6c244d9 to your computer and use it in GitHub Desktop.
A Python script to grouping all users in zimbra
import os
pathtozmprov = "/opt/zimbra/bin/zmprov -l"
f = os.popen(pathtozmprov + ' gaa') #list all users in zimbra mail server
zmprovgaa= []
zmprovgaa = f.readlines()
for i in zmprovgaa:
print i
os.system("/opt/zimbra/bin/zmprov adlm <groupname>@xxxxx.xxx.xx.xx " + i) #add a user to the group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment