Bulk provisioning zmmailbox

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Bulk provisioning zmmailbox

Post by sirio81 »

Hi all, I used successfully bulk provisioning in the past to create users or to change users' passwords.
The syntax is zmprov -f commands.zmp.

I wish to use zmmailbox the same way to export and import users' calendars.
From the help I see it has '-f' option exactly like zmprov

Code: Select all

  -f/--file                                use file as input stream
but I can't find the right syntax to use for the .zmp file.

This is an example with a single line

Code: Select all

nano test.zmp
-z -m test1@domain.com getRestURL "/Calendar/?fmt=tgz" > calendar.tgz

zmmailbox -f test.zmp 
mbox> ERROR: zclient.CLIENT_ERROR (Unknown command: (-z) Type: 'help commands' for a list)
Last edited by sirio81 on Fri Mar 20, 2020 3:29 pm, edited 1 time in total.
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: Bulk provisioning zmmailbox

Post by DualBoot »

I think this one should work
- create the file with following commands inside :

Code: Select all

sm account@domain.tld gru "/Calendar/?fmt=tgz" > /tmp/calendar.tgz
- then execute zmprov :

Code: Select all

zmprov -f mytest-file.txt
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Re: Bulk provisioning zmmailbox

Post by sirio81 »

Doesn't work.
I get the help of zmmailbox.
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: Bulk provisioning zmmailbox

Post by DualBoot »

weird, I have tested it before posted it.
Maybe the version of your Zimbra.
sirio81
Advanced member
Advanced member
Posts: 78
Joined: Sat Sep 13, 2014 12:29 am

Re: Bulk provisioning zmmailbox

Post by sirio81 »

I tried to use also other commands.

I testedt this command
zmmailbox -z -m user@domain.com deleteFolder /sharename
using a bulk file.

Code: Select all

echo "sm user@domain.com deleteFolder /sharename" > tmp.zmb
zmprov -f tmp.zmb
It works!

I try then a litte more complex command I use to share a full account.
I have to set permission first.
I try do do that by bulk file:

Code: Select all

echo "sm tosharei@domain.com mfg / account sharewith@domain.com rwixd" > tmp.zmb
It doens't work.

I have to remove 'mfg', then it works

Code: Select all

echo "sm tosharei@domain.com / account sharewith@domain.com rwixd" > tmp.zmb
I whish to understand the logic so I can apply it to allo zmmailbox commands.
Post Reply