Get all accounts and names

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Marcosebas
Advanced member
Advanced member
Posts: 80
Joined: Tue Sep 13, 2016 11:25 pm

Get all accounts and names

Postby Marcosebas » Mon Jul 15, 2019 5:08 am

Dear All,

Please you help with this. I am trying to get the list of all my users and their display name. WIth zmprov gaa I list all the accounts but not their displayname.

I would like to get a result like this:

xxxyyy@domain.com, xxx yyy.

I need this in order to create a file and create again all these accounts.

I did the follwoing script, however I have around 5k accounts and it is taking around 5 seconds for each account: (In the users.txt I have all the mail accounts)

Code: Select all

#!/bin/bash

for i  in `cat /tmp/users.txt`
do
zmprov ga $i displayName | awk '{printf (NR%2==0) ? $0 "\n" : $0}' >> /tmp/usuarios4.txt
done

exit 1


Thank you in advance for your help,

Marco


Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 14 guests