Forum Discussion
Dynamic Distribution Group User Exclusion Recipient Filter
VasilMichev
I have been using the (get-dynamicdistributiongroupmember -identity $identity | Select-object DisplayName,PrimarySmtpAddress) to get recipients.
I've also been using:
$filter = $TheRecipientFilterSyntax
Get-Recipient -filter $filter | Select-object DisplayName,PrimarySmtpAddress
I'm testing with the following now:
"(((Office -eq 'Spokane, WA')) -or ((Office -eq 'Sandpoint, ID')) -and (RecipientType -eq 'UserMailbox') -and (RecipientTypeDetails -eq 'UserMailbox') -and (-not(Name -like '<service-account's-name>')) -and (-not(Name -like '<service-account's-name>*')))"
I've got a wild-card on the last one because there's a handful of service accounts with ascending numbers that match that ANR.
Thanks for the tip! Hopefully this gets the results I'm looking for.
Will check back in next week.