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