我得到的错误:删除-MsolGroupMember使用的Exchange Online执行此操作
Remove-MsoLGroupMember : You cannot update mail-enabled groups using this cmdlet. Use Exchange Online to perform this operation
但我已经连接到远程会话,并导入了在线交流模块,为何仍抛出错误?
$credential = Get-Credential
$lyncSession = New-CsOnlineSession -Credential $credential
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
Get-PSSession
Import-PSSession $exchangeSession
Remove-MsoLGroupMember -GroupObjectId $Group_GUID -GroupMemberType User -GroupmemberObjectId $GroupMembers.ObjectId
我是按照这个链接来设置我的远程连接交换,但我一定是做错了什么。 https://technet.microsoft.com/en-us/library/dn362787(v=ocs.15).aspx
Remove-MSOLGroupMember不是Exchange Online命令,这就是您遇到错误的原因。您可以尝试使用Remove-DistributiongroupMember(并非100%确定是否这是特定的EXO cmdlet,此刻我没有机器进行验证) – bluuf
Remove-DistributiongroupMember似乎也没有工作。我收到错误消息,“GroupMailbox不支持当前的操作。”正如我在对塞亚姆的回答评论中所描述的那样。 – BLang
那么它必须是一个使用Remove-UnifiedGroupLinks作为删除组员成员的命令的统一组。请注意,Microsoft明确记录了这一点,任何管理O365的人(特别是Powershell)都应该知道组类型之间的区别以及如何管理它们。 – bluuf