Removing a user from all DLs on a server: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
__FORCETOC__ | __FORCETOC__ | ||
<div class="col-md-12 ibox-content"> | <div class="col-md-12 ibox-content"> | ||
=Removing a user from all DLs on a server= | =Removing a user from all DLs on a server= | ||
<hr> | <hr> | ||
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|{{ZCS 8.5}}|}} | |||
====Problem==== | ====Problem==== | ||
Removing a user from all DLs on a server | Removing a user from all DLs on a server | ||
====Solution==== | ====Solution==== | ||
We can do this using a combination of zmsoap and zmprov | |||
We can do this using a combination of zmsoap and zmprov | * 'zmsoap' will get a list of all the distribution lists the user is a member of. So for 'user@example.com': | ||
zmsoap -z GetAccountMembershipRequest/account=user@example.com @by=name | zmsoap -z GetAccountMembershipRequest/account=user@example.com @by=name | ||
* Use this to make a 'zmprov' script that will run 'zmprov rdlm dl@example.com user@example.com' for all the DLs: | |||
zmsoap -z GetAccountMembershipRequest/account=user@example.com @by=name | sed -n 's/.*name="\(.[^"]*\)".*/rdlm \1 user@example.com/p' > /tmp/rdlm.zmprov | zmsoap -z GetAccountMembershipRequest/account=user@example.com @by=name | sed -n 's/.*name="\(.[^"]*\)".*/rdlm \1 user@example.com/p' > /tmp/rdlm.zmprov | ||
The above creates a file '/tmp/rdlm.zmprov', which contains multiple lines in the form of 'rdlm dl@example.com user@example.com'. | The above creates a file '/tmp/rdlm.zmprov', which contains multiple lines in the form of 'rdlm dl@example.com user@example.com'. | ||
* This file is then inputted to zmprov, removing the user from all the DLs: | |||
zmprov < /tmp/rdlm.zmprov | zmprov < /tmp/rdlm.zmprov | ||
{{Article Footer|ZCS 8.8, 8.7, 8.6|2018-05-21}} | {{Article Footer|ZCS 8.8, 8.7, 8.6|2018-05-21}} |
Latest revision as of 13:04, 21 May 2018
Removing a user from all DLs on a server
Problem
Removing a user from all DLs on a server
Solution
We can do this using a combination of zmsoap and zmprov
- 'zmsoap' will get a list of all the distribution lists the user is a member of. So for 'user@example.com':
zmsoap -z GetAccountMembershipRequest/account=user@example.com @by=name
- Use this to make a 'zmprov' script that will run 'zmprov rdlm dl@example.com user@example.com' for all the DLs:
zmsoap -z GetAccountMembershipRequest/account=user@example.com @by=name | sed -n 's/.*name="\(.[^"]*\)".*/rdlm \1 user@example.com/p' > /tmp/rdlm.zmprov
The above creates a file '/tmp/rdlm.zmprov', which contains multiple lines in the form of 'rdlm dl@example.com user@example.com'.
- This file is then inputted to zmprov, removing the user from all the DLs:
zmprov < /tmp/rdlm.zmprov