@gaiusg
You could have a try with this script (modify OnlineList1 to "Pure Cloud"):
$users = Get-DistributionGroupMember OnlineList1 | where {$_.RecipientType -ne "UserMailbox"}
foreach($user in $users){
Remove-DistributionGroupMember -Identity OnlineList1 -Member $user.Name -Confirm:$False
}
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.