0
我已经通过Exchange管理中心将共享邮箱偶然添加到通讯组,并且无法删除它们,因为EAC没有指定邮箱类型(我可能会意外删除常规邮箱)Exchange Online - 从所有通讯组成员身份删除共享邮箱
我试过编写Powershell脚本来完成任务,但它不起作用。
$DistributionGroups = Get-Distributiongroup
$SharedMailboxes = Get-mailbox -RecipientTypeDetails sharedmailbox
ForEach ($Group in $DistributionGroups)
{
ForeEach ($Mailbox in $SharedMailboxes)
{
if ((Get-Distributiongroupmember $Group.Name | select -expand name) -contains $Mailbox)
{
Remove-DistributionGroupMember -Identity "$Group" -Member "$Mailbox"
}
}
}
道歉,我没有看到编辑按钮(我还以为是像reddit的)我刚刚发现第5行语法错误。这已更新。 –
没问题,每个帖子都有它的问题或答案,只要你需要澄清任何东西而不是在评论中添加信息就尽量使用它 –