iamthenev
iamthenev

Reputation: 1

Modify Members of Distribution List in GAL

I am the owner of a distribution list in the Global Address List.
I would like to add/remove members from the list using VBA.

I can reference the distribution list as an AddressEntry or an ExchangeDistributionList, and access member information like .Alias or .Type, but I cannot perform any add/remove functions.

The entry in Microsoft .DistListItem has an AddMembers method but only describes adding members to a new distribution list.
I cannot find any code for adding to existing distribution list.

This link asks my question, but the linked answer only shows how to display the members. It does not explain how to add/remove.

Upvotes: 0

Views: 194

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66316

Keep in mind that DistListItem represents an IPM.DistList item in one of your contacts folders in the mailbox. It does not represent a GAL object, which is represented by the AddressEntry and ExchangeDistributionList objects.

To add a member to a DL, you can use AddressEntry.Members.Add

Upvotes: 0

Related Questions