Automating Reciprocal Calendar Sharing

Revision as of 20:52, 8 February 2010 by Heureso (talk | contribs) (New page: The problem: you've just added a new department of users to your Zimbra server. All of those users need to share their calendars with each of the other members of their department. One s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The problem: you've just added a new department of users to your Zimbra server. All of those users need to share their calendars with each of the other members of their department.

One solution:

First, create a distribution list with all of the relevant user accounts via the Zimbra Admin console.

The following BASH script takes the name of that distribution list as a command line argument, then outputs a series of CLI commands to share each members's calendar (read-only) with the distribution list, then add a mountpoint to each user's shared calendar to the other list members' calendars. The script should be run as the zimbra user.

#!/bin/bash

if [ "$#" == "1" ]
then
users=$(zmsoap --type admin --zadmin GetDistributionListRequest/dl="$1" @by="name" | grep dlm | sed -e 's/.*<dlm>\(.*\)<\/dlm>/\1/g')

echo $users

for u in $users
do
    echo zmmailbox -z -m $u modifyFolderGrant /Calendar group psychstaff@psymail.ucdavis.edu r
    uname=$(zmmailbox -z -m $u gid -v | grep zimbraPrefFromDisplay | sed -e 's/.*: "\(.*\)",/\1/')
    for v in $users
    do
        if [ $u != $v ]
        then
            echo zmmailbox -z -m $v createMountpoint --view appointment \"/$uname\'s Calendar\" $u /Calendar
        fi
    done
done
else
    echo "usage: $0 distlist@zimbradomain.com"
fi
Jump to: navigation, search