Remove all members from DL via CLI

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
khawkins
Posts: 12
Joined: Sat Dec 11, 2021 12:25 am
ZCS/ZD Version: 8.8.15

Remove all members from DL via CLI

Post by khawkins »

I had trouble searching for a good way to remove all members from a distribution list via command line. Deleting the DL and recreating it results in losing any special properties the DL might have had (such as recursive membership in another DL). "zmprov rdlm" appears to only take a single address and takes several seconds to complete, so looping it takes a very long time for lists with hundreds of members.

I figured out a way to do this with a single zmprov command and wanted to share it here in case anyone else searches for this functionality in the future.

Code: Select all

zmprov mdl list@example.com zimbraMailForwardingAddress ""
Post Reply