Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-2008, 10:19 AM
Active Member
 
Posts: 28
Default [SOLVED] Generate list of all users on server?

I'm looking to generate a flatfile list of all users and aliases on the system for use at the gateway MX-- later in time I'll query LDAP directly, but right now that's unworkable for a couple reasons.

There a zmprov command or an LDAP query to do this?
Reply With Quote
  #2 (permalink)  
Old 04-23-2008, 10:28 AM
Advanced Member
 
Posts: 193
Default

hey try this as the zimbra user

zmaccts | grep "@" | awk '{print $1}'

or just zmaccts for all the information

or

zmaccts | mail -s "ZMACCTS Information" user@example.tld
Reply With Quote
  #3 (permalink)  
Old 04-23-2008, 11:22 AM
Active Member
 
Posts: 28
Default

Thanks!

Will this work on aliases and distribution lists as well?
Reply With Quote
  #4 (permalink)  
Old 04-23-2008, 05:29 PM
Moderator
 
Posts: 6,237
Default

To get all the lists:
zmprov gadl

or just those in a domain:
zmprov gadl domain.com

get membership info:
zmprov gdlm list@domain.com

to see the members of a particular list:
zmprov gdl list@domain.com

to add a member:
zmprov adlm list@domain.com user@domain.com

to remove a member:
zmprov rdlm list@domain.com user@domain.com

to create a list:
zmprov cdl newlist@domain.com

to delete a list:
zmprov ddl deletethislist@domain.com

rename list:
zmprov rdl list@domain.com newlistname@domain.com

add list alias:
zmprov adla list@domain.com newalias@domain.com

remove list alias:
zmprov rdla list@domain.com aliastoremove@domain.com
Reply With Quote
  #5 (permalink)  
Old 07-05-2010, 04:23 PM
Intermediate Member
 
Posts: 19
Default to find all users

mysql -D zimbra -Be "select comment from mailbox"
Reply With Quote
  #6 (permalink)  
Old 07-05-2010, 09:34 PM
Active Member
 
Posts: 28
Default

Hah, wow-- thanks for the help!

I didn't expect to see this updated two years later, but it's definitely appreciated!
Reply With Quote
  #7 (permalink)  
Old 08-30-2010, 10:58 PM
Intermediate Member
 
Posts: 22
Default get list of users and print in a file

Hello All,

This is a very useful link it solved my 90% problem. I can now get list of all the users. little problem is there any way to get the list of all users and print it in a file or export them to my local pc. I have created the file by touch but don't know how can i redirect or save all the user list in a file.

zmaccts | grep "@" | awk '{print $1}'

Thanks in Advance,

Sikander
Reply With Quote
  #8 (permalink)  
Old 08-31-2010, 12:40 AM
Moderator
 
Posts: 7,928
Default

Code:
zmaccts | grep "@" | awk '{print $1}' > accounts.txt
and then copy the resulting file back to your workstation.
__________________
Reply With Quote
  #9 (permalink)  
Old 09-13-2010, 11:40 AM
Senior Member
 
Posts: 51
Default

Many of these commands work well for listing accounts but I need to export it with name and last name too. How should I do it?

Thanks in advance,

Pancho
Reply With Quote
  #10 (permalink)  
Old 09-27-2010, 10:53 PM
Intermediate Member
 
Posts: 22
Default account list

Hello uxbod,

Thank you for your great support. I have tried on my testing server it is perfectly ok. But when i tried on production it is giving me permission denied error. Even the permissions are same.

zmaccts | grep "@" | awk '{print $1}' > accounts.txt

should i changed the permission If i do then it is not starting postfix correctly. Any other way to generate this account list in a file.

Thanks in Advance,

Sikander
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.