Forum Discussion
gnussbaum
Dec 30, 2022Copper Contributor
creating a dynamic distribution group with a RecipientFilter of 'Description'
I'm trying to create a dynamic distribution group of full-time employees. Their status is in the user's account description. I've tried the following to no avail: New-DynamicDistributionGroup -Na...
Rene_Gross
Jan 04, 2023Iron Contributor
gnussbaum hello, maybe this helps:
- i have only exchange on-prem
New-DynamicDistributionGroup -Name "DDL-Test" -Alias DDL-Test -OrganizationalUnit "yourAdDomain/yourOU/yourOUforSavingDistributingList" -RecipientFilter {((RecipientTypeDetails -eq 'UserMailbox') -and (Description -eq 'Employee'))} -RecipientContainer "yourAdDomain/yourOU/OUwithUsers"
- you dont need Parameter "-RecipientContainer", if your scope is the entire AD
- i didnt do this with the description field, but can test this in the next few days
- if you have exchange online would say is the same, but not sure
best wishes
René
TonyRedmond
Jan 06, 2023MVP
Maybe you could use of the custom attributes instead and script the copying of the description field into the custom attribute?
- gnussbaumJan 06, 2023Copper ContributorThanks for replying Tony. I was thinking of that, but to be honest, I'm not sure how to do that.
- TonyRedmondJan 06, 2023MVPFor existing on-premises accounts, you could probably use Get-ADUser to read the description and Set-Mailbox to write the description into a custom attribute, I don't have an on-premises environment to test with to confirm.