Forum Discussion
Dynamic Distribution Group not returning membership values
Hello and thank you in advance. We use EXO and we have nothing on premises. I am able to create a DDL using the following;
New-DynamicDistributionGroup -Name "Hospice Clinical Directors Email" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (Title -like 'Clinical Director*')"
Name ManagedBy
---- ---------
Hospice Clinical Directors Email
As shown above the group is created and I can also see it in the EAC, My problem I am currently facing is I cannot run any get- cmd to show membership. Examples are as follows;
C:\Windows\system32> # Get the DDL's RecipientFilter string
>> $filter = (Get-DynamicDistributionGroup -Identity "Hospice Clinical Directors Email").RecipientFilter
PS C:\Windows\system32> # Get recipients that match the DDL's RecipientFilter string | Show the name, title, and email address
I can run a separate cmd to verify users meet the criteria to be added(Users changed for security)
Get-Recipient -RecipientPreviewFilter $filter | Select-Object Name,Title,PrimarySMTPAddress
PS C:\Windows\system32> Get-Recipient -RecipientPreviewFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (Title -like '*Clinical Director*')"
Name RecipientType
---- -------------
Blovelady UserMailbox
Jthompson UserMailbox
Pthetford UserMailbox
Lburney UserMailbox
Wbarker UserMailbox
With all that said I can recreate the same group but use -EQ instead of -Like, but this is not what we are wanting. As that is not scalable in the future and growth. Can anyone please tell me when when I create a DDL using a wildcard -Like, it does not bring in any members? I have read through all the MS docs I can find and every cmd that should return a value is not.
TLDR; I need to create a DDL using -Like to pull multiple users with different job titles. We use EXO and have no physical server.
- The Title property does not accept wildcards, so you can only use -eq. I suppose you can populate the same values in one of the custom attributes, which do support -like.
- KayvaultCopper ContributorIn terms of initial creation? Or just when running the Get- cmd? Because it seems to create the group just fine.