Forum Discussion
JasonPPF
Dec 10, 2022Copper Contributor
Remove-DistributionGroup role issues
If I need to remove DistributionGroup with Powershell by using Remove-DistributionGroup commond.
(I'm not owner, not admin role)
I checked document, looks like
【You have to be an Exchange Online admin, an Exchange admin, or a member of the "Security Group Creation and Membership" role in the Exchange admin center to perform this procedure.】
Or DistributionGroup's owner maybe?
Would that be possible to Remove-DistributionGroup below:
1-1. Ask sufficient permissions role
1-2. Set-DistributionGroup <NameOfGroup> -ManagedBy "MyAccount" -BypassSecurityGroupManagerCheck ===> By admin role.
1-3. Remove-DistributionGroup ===> By myself.
Or
2-1. Set-DistributionGroup <group> -ManagedBy @{Add="MyAccount"} -BypassSecurityGroupManagerCheck ===> By myself.
2-2. Remove-DistributionGroup ===> By myself.
Thanks for checking, any help and advice will be appreciated!!
- Well you can, if you are an owner and the tenant allows owners to self-manage/delete groups.
- Only an admin can make you an owner of the group, or use the BypassSecurityGroupManagerCheck parameter for that matter.
- JasonPPFCopper ContributorThank you for replying!
So no matter whitch way, an admin is necessary.
Or is there have another workaround without admin role can remove DistributionGroup?- Well you can, if you are an owner and the tenant allows owners to self-manage/delete groups.