Works fine here, make sure you have the necessary permissions to run the cmdlet with said parameter. By default, you need to have the Distribution Groups role assigned to do so. Don't forget to reconnect to PowerShell after any permissions change.
A parameter cannot be found that matches parameter name 'ForceMembershipRefresh'.
Trying to refresh DDG per: https://learn.microsoft.com/en-us/exchange/recipients-in-exchange-online/manage-dynamic-distribution-groups/troubleshoot-ddg-membership-issues
I want to force refresh the membership list of a dynamic distribution group
You might want to consider forcing a membership refresh on the DDG if:
- ...
To perform a refresh, replace DDGIdentity with the name, alias, or email address of the DDG in the following command in Exchange Online PowerShell, and run it:
Set-DynamicDistributionGroup -Identity <DDGIdentity> -ForceMembershipRefresh
Set-DynamicDistributionGroup -Identity "~All Users" -ForceMembershipRefresh
error: Set-DynamicDistributionGroup : A parameter cannot be found that matches parameter name 'ForceMembershipRefresh'
Get-DynamicDistributionGroupMember -Identity "~All Users"
getting the members is successful.
any thoughts?