Created
February 25, 2017 08:28
-
-
Save Mostafa-Hamdy-Elgiar/f3ccbb4b0b5ffb492b892846f6c244d9 to your computer and use it in GitHub Desktop.
A Python script to grouping all users in zimbra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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