Issue Description
I encountered an issue with the command not returning the expected membership details of a dynamic distribution group. PowerShell returned zero results and UI didn’t provide detail because this Dynamic DL was having custom fileters.
Troubleshooting
I created one dynamic DL with short query but it was having the same issue. All other commands were working fine.
New-DynamicDistributionGroup -Name "SJTestOnly" -Alias SJTestOnly -RecipientFilter {(department -eq "PMO Office")}
$FTE = Get-DynamicDistributionGroup -Identity "SJTestOnly"
Get-Recipient -RecipientPreviewFilter ($FTE.RecipientFilter)
Cause and Fix
I didn’t find any article about the issue but suddenly realized that i am not running the latest version of Exchange Online Management module. I had 3.2.0 version and latest was 3.4.0.
Following the module update, I was able to fetch the recipients successfully, and the count matched the expected value.
Update-Module ExchangeOnlineManagement -RequiredVersion 3.4.0
Thank you for reading !