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 11-13-2008, 01:26 AM
Active Member
 
Posts: 33
Default export account from Web Admin Panel

Hi,

Is there any way to export a specific accounts's list, from the Web Admin Panel?

For example: if I want to export all accounts "@specificdomain.tld', I can insert the string "specificdomain.tld" on the search FORM on the top of the Panel, so I get all the accounts I want; now I would like to export the founded accounts's list.

I know that I can use the 'zmprov' command from the CLI, but I don't want to give access to the server, so I need some tool to perform the same task from the Web Admin Panel.

Can anyone Help me?

Thanks

Elisa
Reply With Quote
  #2 (permalink)  
Old 11-13-2008, 02:56 AM
Zimbra Consultant & Moderator
 
Posts: 20,312
Default

You'll need to use zmprov at the command line for that function.
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 11-13-2008, 07:24 AM
Active Member
 
Posts: 33
Default

This is my question:

If I want to extract all account with a zimbraMailCanonicalAddress like '*@specificdomain.tld', Is there a specific zmprov command?

I have used zmprov gaa -v, but it is too much verbose.

Thanks

Elisa
Reply With Quote
  #4 (permalink)  
Old 09-07-2009, 07:33 AM
Active Member
 
Posts: 27
Default

guys i have the same problem, i need to export 500 users from zcs 5.0.14 into a *.csv file, the command zmprov gaa -v is displaying a whole list of info which i don't need right now,

can any one help me in making the script that will then parse the output into a *.csv file so that i upload it onto another machine.

i just need the user names only and their passwords.

regards
Reply With Quote
  #5 (permalink)  
Old 09-07-2009, 08:00 AM
Active Member
 
Posts: 33
Default

Dear buggz,

You can't use the CLI zmprov command to extract account password.

If you need only the user name you can easily use zmprov gaa -v |grep uid:

Make me know if this help you.

Elisa
Reply With Quote
  #6 (permalink)  
Old 09-07-2009, 08:06 AM
Active Member
 
Posts: 27
Default

wow, quick reply

what i really need is :
a file with the following email@mydomain.com,Username Surname into a *.csv file.

if there is another tool that i might need to get the password its ok, but what i mainly need are the user names and the Distribution lists


regards
buggz
Reply With Quote
  #7 (permalink)  
Old 09-07-2009, 08:35 AM
Active Member
 
Posts: 33
Default

Dear buggz,

I made a simple python script to do such extraction. I post it here for utility.


#! /usr/bin/env python
# this script requires you have extracted the file list with the zimbra CLI: zmprov gaa -v > /opt/zimbra/list. Plus the path in which you save the script has to be the same of the list file.
elisa_file = open("list","r")
lista = []
record = {}
for row in elisa_file.readlines():
if row.strip() == '':
lista.append(record)
record = {}
if row[0] == '#':
pass
else:
record.update({row[:row.find(':')]: row[row.find(':')+1:]})

for x in lista:
if 'mail' in x: print 'mail: ' + x['mail']
if 'uid' in x: print 'uid: ' + x['uid']
if 'sn' in x: print 'sn: ' + x['sn']
print '--------------------------------------------------------------------------------------------------------------------------------------------------------------'



This is the procedure you have to follow:

1. from the zimbra CLI: zmprov gaa -v > /opt/zimbra/list
2. than you can use my script to extract the folder that you are looking for. The path for the script has to be the same of the extracted list es:

cp /opt/zimbra/list /path-that-you-want
cp elisa_parser.py in /path-that-you-want

than you have to execute the script as follow:
  • cd /path-that-you-want
  • python elisa_parser.py > output_file.csv

If you want to extract additional folder the only thing you have to do is to add the desired folder in the for instruction.

I wish this can help you.

Elisa
Reply With Quote
  #8 (permalink)  
Old 09-07-2009, 10:38 PM
Active Member
 
Posts: 27
Default

im not sure where i got it wrong, it had been talkinf of ython Error:IndentationError: expected an indented block. so i edited it to:
HTML Code:
#! /usr/bin/env python
# this script requires you have extracted the file list with the zimbra CLI: zmprov gaa -v > /opt/zimbra/list. Plus the path in which you save the script has to be the same of the list file.
elisa_file = open("list","r")
lista = []
record = {}
for row in elisa_file.readlines():
 if row.strip() == '':
  lista.append(record)
  record = {}
 if row[0] == '#':
  pass
else:
 record.update({row[:row.find(':')]: row[row.find(':')+1:]})

for x in lista:
 if 'mail' in x: print 'mail: ' + x['mail']
 if 'uid' in x: print 'uid: ' + x['uid']
 if 'sn' in x: print 'sn: ' + x['sn']
 print '--------------------------------------------------------------------------------------------------------------------------------'
the Output is like this:
HTML Code:
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------

i think its something to do with the LAST print statement isnt it?

buggz
Reply With Quote
  #9 (permalink)  
Old 09-08-2009, 12:06 AM
Active Member
 
Posts: 33
Default

Hi buggz,

The else statement at the ninth line have to be aligned with other if instruction inside the for cycle.

Elisa

Last edited by elisa; 09-08-2009 at 12:13 AM..
Reply With Quote
  #10 (permalink)  
Old 09-08-2009, 12:08 AM
Active Member
 
Posts: 33
Default

Make mi know if this help.

Last edited by elisa; 09-08-2009 at 12:15 AM..
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.