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
  #11 (permalink)  
Old 08-25-2009, 04:06 PM
Advanced Member
 
Posts: 203
Default

I'm trying to get a list of accounts WITHOUT an alias. I can list all accounts, and list accounts with aliases (with scripts in this forum post), but anyone know of a way to compare those two lists to create one?
Reply With Quote
  #12 (permalink)  
Old 09-15-2009, 02:08 PM
Advanced Member
 
Posts: 203
Default

Ok, now I'm trying to get a csv exported of 3 columns: e-mail, first name, last name. The closest I get is from:

zmprov gaa -v | grep -e name -e sn -e givenName | awk 'ORS=","' > all_accounts.csv

But there's a lot of extra "junk" in the output. Anyone know how to get what I'm looking for?
Reply With Quote
  #13 (permalink)  
Old 10-23-2009, 08:40 AM
Active Member
 
Posts: 28
Default

Mike or anyone,

I'm having permission difficulties.
"zimbra:/Users/zimbra zimbra$ zmprov gdl pga@pubgroup.com > dist-list.txt
su: dist-list.txt: Permission denied"

I'm in the user "zimbra" directory?

Any assistance appreciated!
Reply With Quote
  #14 (permalink)  
Old 10-23-2009, 09:44 AM
Advanced Member
 
Posts: 203
Default

The "Zimbra directory" is owned by root, so you won't be able to put files in that folder as the user Zimbra. As the Zimbra user, run this:

mkdir ~/tmp
zmprov gdl pga@pubgroup.com > ~/tmp/dist-list.txt

Your file will be output to /opt/zimbra/tmp (on a default Linux Zimbra install).
Reply With Quote
  #15 (permalink)  
Old 10-23-2009, 09:50 AM
Active Member
 
Posts: 28
Default

Blazeking,

Thanks for the quick reply. I am on an Mac OSX (10.4) server.

I get this when I run that command:
zimbra:/Users/zimbra zimbra$ mkdir ~/tmp
mkdir: /opt/zimbra/tmp: Permission denied

Obviously, I'm a newbie on the command line. Is there a specific directory I need to be when running this?
Reply With Quote
  #16 (permalink)  
Old 02-10-2010, 05:24 AM
Intermediate Member
 
Posts: 22
Default

Quote:
Originally Posted by mmorse View Post
Welcome to the forums,

Code:
mkdir /opt/zimbra/info
chown zimbra.zimbra /opt/zimbra/info
su - zimbra
cd info
To get a printout of all your accounts:
Code:
zmprov gaa > accounts.txt
or
Code:
zmaccts | grep "@" | awk '{print $1}' > accounts.txt
or
Code:
 /opt/zimbra/bin/zmaccts | grep 'active' | egrep -v '^\W+' | awk '{print $1}'
or
Code:
 /opt/zimbra/openldap/bin/ldapsearch -LLL -x -D"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_userdn | \
       awk '{print $3}'`" -w"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_password | \
       awk '{print $3}'`" -H `/opt/zimbra/bin/zmlocalconfig ldap_url | \
       awk '{print $3}'` $* | \
       grep ^mail | \
       awk '{print $2}' | \
       sort > zimbra_recipients.list
Exporting all addresses - Zimbra :: Wiki

To get a printout of all your distribution lists:
Code:
zmprov gadl > alllists.txt
To print out the members for a given distribution list:
Code:
zmprov gdl dist-list@domain.com > dist-list.txt
To show if that particular distribution list is a member of other distribution lists:
Code:
zmprov gdlm dist-list@domain.com > dist-list-membership.txt
Bug 19157 - Ability to export GAL as a CSV file (admin console)
You can use awk & print to do so from CLI.
For instance:
Code:
zmprov gdl dist-list@domain.com | awk 'ORS=","' > list.csv
So in this case, the following code:
Quote:
/opt/zimbra/openldap/bin/ldapsearch -LLL -x -D"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_userdn | \
awk '{print $3}'`" -w"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_password | \
awk '{print $3}'`" -H `/opt/zimbra/bin/zmlocalconfig ldap_url | \
awk '{print $3}'` $* | \
grep ^mail | \
awk '{print $2}' | \
sort > zimbra_recipients.list
will get me the username and password that I can use to migrate from one zimbra server to another zimbra server, is that right?
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.