External Recipients as DL members

Deleted
Not applicable

Hello All,

 

does anybody has any script which search for specific external recipients from DL group members?

 

for e.g. yahoo.com or gmail.com

1 Reply

Well you cannot add them directly, you need a matching mail user/mail contact object. So just look for the relevant recipient types and match them against a domain. For example

 

Get-Recipient | ? {$_.EmailAddresses -like "*gmail.com*"}

 

Or for a given DG:

 

Get-DistributionGroupMember DG | ? {$_.EmailAddresses -like "*outlook.com*"}