You could use the script below to check which dynamic distribution group this mailbox contained in: Modify this part before running where{$_.Name -eq "user1"})
$groups = Get-DynamicDistributionGroup -ResultSize unlimited
foreach ($group in $groups){
$Temp = Get-DynamicDistributionGroup -Identity $group.Name
If (Get-Recipient -RecipientPreviewFilter ($temp.RecipientFilter) -OrganizationalUnit ($temp.RecipientContainer) | where{$_.Name -eq "user1"}){
Write-Host $group.Name
}
}
There exists an issue with this script, if user1 is contained in a nested group for this dynamic distribution group, it cannot be found out.
I suggest you try another way, you can find the correct group even if user1 is contained in a nested group:
Create this rule for dynamic distribution group, then send emails to this dynamic distribution group. If user1 received that email, if means user1 contained in that group, other group members will not receive email.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.