Check if current user belongs to a distribution list

  • Thread starter Thread starter Yahya Saad
  • Start date Start date
Y

Yahya Saad

Dear Sirs,

How can I check if the current user belongs to a distribution list
existing on the global address list.

Regards,
Yahya
 
Extended MAPI only - open the PR_EMS_AB_IS_MEMBER_OF_DL property as
IMAPITable to list all DLs the the given user belongs to.
Otherwise loop through the DL members and compare the user's entry id with
the entry ids of all DL members.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Then you will need to loop through all DL members and compare the entry ids
with the entry id of a given recipient.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
How can I reference the Distribution Lists in the Global Address List?

Thank you,
Yahya
 
By name (AddressList.AddressEntries.Item('the name")) or by an index. For a
given address entry, check the AddressEntry.Members collection. It will be
NULL if the address entry is not a DL.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
This is not meant to contradict Dmitry's answer in any way (it's completely
correct) but rather add a higher level verification to an entry -

You should first check the AddressEntry.DisplayType to see if it is of type
olDistList (value = 1) first (there are other values to this but have as yet
to have someone tell me or encounter where these would be used within the
GAL) . That would indicate that this is a Global Distribution Group with no
members if AddressEntry.Members is null (or Nothing). At the same time, you
should also take into account that Distribution Groups can also have
<embedded> distribution groups so you should allow for that possibility.

The only validation we've seen so far is that you cannot include a GDG that
references itself but child references may well include references to a
global parent (in effect causing a very large circular reference if you are
traversing the tree - not a major issue in normal cases).

Karl
 
Back
Top