I have tested and confirm that the command works fine for removing DL members.
If you want to skip the built-in confirmation prompt while executing the command, use this exact syntax: -Confirm:$false
:
Import-CSV C:\list.csv | ForEach { Remove-DistributionGroupMember -Identity distributionlist@contoso.com -Member $_.users -Confirm:$false}
Reference: Remove-DistributionGroupMember.
If an Answer is helpful, please click "Accept Answer" and upvote it.
**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. **