Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Export users

  1. #1
    viaris is offline Senior Member
    Join Date
    Jun 2009
    Posts
    61
    Rep Power
    6

    Default Export users

    Hi all

    I need to export all my users (email and description) to csv file, i am uisng

    zmprov gaa but this command only return the email, I need 2 fields email and description.

    Regards.

  2. #2
    bdial's Avatar
    bdial is offline Moderator
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    you could do a basic bash script to loop through all users

    Code:
    for i in `zmprov gaa` do
      (stuff here)
    done

  3. #3
    viaris is offline Senior Member
    Join Date
    Jun 2009
    Posts
    61
    Rep Power
    6

    Default

    Hi

    But I not understand , what is the instruction inside the cycle ??

    Regards.

  4. #4
    bdial's Avatar
    bdial is offline Moderator
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    you can do any number of commands inside the loop. if you do zmprov ga <account> you'll see all the attirbutes of the account. then you can do zmprov ga <account> <attribute1> <attribute2> and that will grab the attributes of the account you specify

  5. #5
    blazeking is offline Advanced Member
    Join Date
    May 2008
    Location
    California!
    Posts
    226
    Rep Power
    7

    Default

    I'm also having trouble with this. :-) What would be the code if I wanted to print account name and the attributes of First and Last Name?

  6. #6
    veronica is offline Outstanding Member
    Join Date
    Jun 2008
    Posts
    594
    Rep Power
    8

    Default

    for i in `zmprov gaa` do
    zmprov ga accountname gn
    done

    same way use sn for last name

  7. #7
    blazeking is offline Advanced Member
    Join Date
    May 2008
    Location
    California!
    Posts
    226
    Rep Power
    7

    Default

    Ok, I'm showing my inexperience... So this would be my script?:

    #!/bin/bash
    for i in `zmprov gaa` do
    zmprov ga accountname gn
    done

    I guess I'm not sure how to run this... I keep getting "-bash: syntax error near unexpected token `zmprov'".

  8. #8
    veronica is offline Outstanding Member
    Join Date
    Jun 2008
    Posts
    594
    Rep Power
    8

    Default

    Running as zimbra user ?

  9. #9
    blazeking is offline Advanced Member
    Join Date
    May 2008
    Location
    California!
    Posts
    226
    Rep Power
    7

    Default

    Yes, unless their's something I need to change in the script. I ran it as Zimbra user.

  10. #10
    veronica is offline Outstanding Member
    Join Date
    Jun 2008
    Posts
    594
    Rep Power
    8

    Default

    You ran the script as it is. ok change it :-
    #!/bin/bash
    for i in `zmprov gaa` do
    zmprov ga $i gn
    done

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] my server stopped working???
    By cecil in forum Administrators
    Replies: 4
    Last Post: 04-20-2008, 08:07 AM
  2. installation error during ldap setup
    By ljramos in forum Installation
    Replies: 23
    Last Post: 08-10-2007, 10:48 PM
  3. unable to restart zimbra after reboot
    By droefs in forum Administrators
    Replies: 28
    Last Post: 04-16-2006, 02:33 PM
  4. Replies: 16
    Last Post: 01-05-2006, 09:55 AM
  5. After Succesfull Install, Cannot Start mta
    By bsimzer in forum Installation
    Replies: 26
    Last Post: 12-16-2005, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •