Forum Discussion
np123
Nov 17, 2025Copper Contributor
Update Dynamic Distribution List
we are a hybrid environment, running exchange 2019 and have a few DDLs which have been around from previous exchange versions. One of the DDLs i need to modify is the below. Its hard to read and i am...
np123
Nov 23, 2025Copper Contributor
ok, thanks. So in terms of running the command, co-pilot told me the below command would work (i havent tested it as its an important DDL). Do you think this will work or not go with including what will be added back?
Set-DynamicDistributionGroup -Identity "Your-DDG-Name" -RecipientFilter "(
(
(((((((((((((((((((((((Company -eq 'Contoso') -and (CustomAttribute4 -eq 'City')) -and
((CustomAttribute7 -eq 'Group') -or (CustomAttribute7 -eq 'Contractor') -or (CustomAttribute7 -eq 'Permanent'))) -and
((RecipientType -eq 'UserMailbox') -or ((RecipientType -eq 'MailUser') -and (CustomAttribute12 -ne 'Excluded')))) -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'))) -and
(-not(RecipientTypeDetailsValue -eq 'AuxAuditLogMailbox'))) -and
(-not(RecipientTypeDetailsValue -eq 'SupervisoryReviewPolicyMailbox'))
) -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')) -and
(-not(RecipientTypeDetailsValue -eq 'AuxAuditLogMailbox')) -and
(-not(RecipientTypeDetailsValue -eq 'SupervisoryReviewPolicyMailbox'))
) -or (CustomAttribute3 -eq 'test')"