Hi,
We have a very large dynamic distribution group that contains all the companies employees. I would very much like to exclude certain employees from this list, but i'm having trouble getting it to work.
The setup is a hybrid exchange 2010 on-premise and O365/Exchange Online.
Here is the filter:
{((((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailUser'))) -and (-not(MemberOfGroup -eq 'CN=Excluded From Dynamic,OU=Distribution Groups,OU=xxx,OU=xxxx,DC=xxxx,DC=xxxx -and (-not(RecipientTypeDetailsValue -eq 'RoomMailBox')) -and (-not(RecipientTypeDetailsValue -eq 'EquipmentMailbox')) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'PublicFolderMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'AuditLogMailbox')))}
The -and(-not(MemberofGroup -eq 'CN=....." has been replaced with -and(MemberOfGroup -ne 'CN=...'.
The results are the same..the members of the group i wish to exclude, are not excluded. The group that contains the members i wish to exclude, is a mail-enabled universal security group.
Any help would be greatly appreciated.