A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Yes, this will work, but you need to make a few changes. See below
Add this to not get prompted.
Test with just a few first!!!!
ForEach ($item in $DLList){Remove-DistributionGroup -Identity $item.Aliases -BypassSecurityGroupManagerCheck $true -Confirm:$false}
Note that I set -BypassSecurityGroupManagerCheck $true. You need that true to process