-
Notifications
You must be signed in to change notification settings - Fork 17
/
delegate-admin
68 lines (56 loc) · 2.36 KB
/
delegate-admin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Domain of concern to be changed
DOMAIN='example.com'
WHO=`whoami`
if [ $WHO != "zimbra" ]
then
echo
echo "Execute this scipt as user zimbra (\"su - zimbra\")"
echo
exit 1
fi
echo
echo
echo "Zimbra Delegate Admin control"
echo "*************************************************"
echo "Utility to grant/revoke delegated administrators"
echo
echo "Please choose R for revoke or G for grant (RG) or any other key to abort."
read -p "RG: " rg
if [ "$rg" == 'R' ]
then
echo "Please enter the user name (example: [email protected]) you wish to revoke delegated domain admin rights from."
read -p "username: " username
zmprov ma $username zimbraIsDelegatedAdminAccount FALSE
elif [ "$rg" == 'G' ]
then
echo "Please enter the user name (example: [email protected]) you wish to grant delegated domain admin rights."
read -p "username: " username
zmprov ma $username zimbraIsDelegatedAdminAccount TRUE
zmprov ma $username +zimbraAdminConsoleUIComponents accountListView
zmprov ma $username +zimbraAdminConsoleUIComponents DLListView
zmprov grr domain $DOMAIN usr $username +listAccount
zmprov grr domain $DOMAIN usr $username listDomain
zmprov grr domain $DOMAIN usr $username set.account.zimbraAccountStatus
zmprov grr domain $DOMAIN usr $username set.account.sn
zmprov grr domain $DOMAIN usr $username set.account.displayName
zmprov grr domain $DOMAIN usr $username +addDistributionListMember
zmprov grr domain $DOMAIN usr $username +getDistributionListMembership
zmprov grr domain $DOMAIN usr $username +getDistributionList
zmprov grr domain $DOMAIN usr $username +listDistributionList
zmprov grr domain $DOMAIN usr $username +removeDistributionListMember
zmprov grr domain $DOMAIN usr $username domainAdminRights
zmprov grr domain $DOMAIN usr $username domainAdminConsoleRights
zmprov grr domain $DOMAIN usr $username adminConsoleAliasRights
zmprov grr domain $DOMAIN usr $username modifyAccount
zmprov grr domain $DOMAIN usr $username countAlias
zmprov grr domain $DOMAIN usr $username -configureAdminUI
zmprov grr domain $DOMAIN usr $username -get.account.zimbraAdminConsoleUIComponents
zmprov grr domain $DOMAIN usr $username -get.dl.zimbraAdminConsoleUIComponents
zmprov grr domain $DOMAIN usr $username -set.account.zimbraIsDelegatedAdminAccount
zmprov grr domain $DOMAIN usr $username -set.dl.zimbraIsAdminGroup
else
echo "Invalid option, abort"
exit 0
fi
exit 0