Results 1 to 3 of 3

Thread: zmprov modifyAccount multiple attributes at once

  1. #1
    lieutdan13 is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    2

    Question [SOLVED] zmprov modifyAccount multiple attributes at once

    Since the zmprov tool is very heavy and takes at least 5 secs (on my server) to set an account attribute, I was wondering if it is possible and what syntax to use to modify multiple attributes with one zmprov call?

    In a script reading a tab-delimited/csv file, I'm doing something like this:
    Code:
    zmprov ma $uid@$domain zimbraCOSid "$cosid"
    zmprov ma $uid@$domain cn "$uid"
    zmprov ma $uid@$domain givenName "$first"
    zmprov ma $uid@$domain sn "$last"
    zmprov ma $uid@$domain displayName "$first $last"
    zmprov ma $uid@$domain zimbraPasswordMustChange FALSE
    zmprov ma $uid@$domain zimbraPrefGalAutoCompleteEnabled TRUE
    zmprov ma $uid@$domain zimbraPrefSharedAddrBookAutoCompleteEnabled TRUE
    This takes about 45 secs per user. If I add more "ma" commands, it will take even longer. Thanks in advance.

  2. #2
    federico.bertola's Avatar
    federico.bertola is offline Special Member
    Join Date
    Jul 2006
    Location
    Verona, Italy
    Posts
    153
    Rep Power
    9

    Default

    You have 2 way to achieve this, with a one line command or with one instance of zmprov:

    * One line:
    Code:
    zmprov ma $uid@$domain zimbraCOSid "$cosid" cn "$uid" \
              givenName "$first" sn "$last" displayName "$first $last" \
              zimbraPasswordMustChange FALSE zimbraPrefGalAutoCompleteEnabled TRUE
              zimbraPrefSharedAddrBookAutoCompleteEnabled TRUE
    * One zmprov instance:
    Code:
    echo 'zimbraCOSid "$cosid" cn "$uid"' > command.zmprov
    echo 'givenName "$first" sn "$last" displayName "$first $last" ' >> command.zmprov
    echo 'zimbraPasswordMustChange ' >> command.zmprov
    echo 'FALSE zimbraPrefGalAutoCompleteEnabled TRUE' >> command.zmprov
    echo 'zimbraPrefSharedAddrBookAutoCompleteEnabled TRUE ' >> command.zmprov
    zmprov < command.zmprov
    Federico Bertola
    CTO @ StudioStorti

  3. #3
    lieutdan13 is offline Member
    Join Date
    Sep 2012
    Posts
    14
    Rep Power
    2

    Default

    Quote Originally Posted by federico.bertola View Post
    Code:
    zmprov ma $uid@$domain zimbraCOSid "$cosid" cn "$uid" \
              givenName "$first" sn "$last" displayName "$first $last" \
              zimbraPasswordMustChange FALSE zimbraPrefGalAutoCompleteEnabled TRUE
              zimbraPrefSharedAddrBookAutoCompleteEnabled TRUE
    This worked perfectly! The documentation indicates only one attribute is allowed to be passed at one time, so I wasn't sure of its syntax:
    modifyAccount ma {name@domain|id|adminName} [attribute1 value1 etc]
    Example: zmprov ma joe@domain.com zimbraAccountStatus maintenance

    After re-reading it, I guess that's what "etc" means Thanks for your help!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. zmprov modifyAccount issue (fowarding)
    By Amin Kardan in forum Administrators
    Replies: 3
    Last Post: 01-08-2009, 08:21 AM
  2. list of attributes for zmprov ca
    By danny.sierra@omtech.net in forum Administrators
    Replies: 3
    Last Post: 02-12-2008, 12:07 PM
  3. Zmprov Attributes
    By glitch23 in forum Administrators
    Replies: 1
    Last Post: 08-06-2007, 05:36 PM
  4. zmprov attributes
    By manking in forum Installation
    Replies: 5
    Last Post: 03-09-2007, 01:38 PM
  5. zmprov createAccount Attributes
    By SomeJ in forum Migration
    Replies: 0
    Last Post: 03-08-2007, 12:58 PM

Tags for this Thread

Posting Permissions

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