Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 删除MsolGroupMember使用exchange online执行此操作_Powershell_Exchange Server_Exchangewebservices - Fatal编程技术网

Powershell 删除MsolGroupMember使用exchange online执行此操作

Powershell 删除MsolGroupMember使用exchange online执行此操作,powershell,exchange-server,exchangewebservices,Powershell,Exchange Server,Exchangewebservices,我得到一个错误: 删除MsoLGroupMember:无法使用更新已启用邮件的组 此cmdlet。使用Exchange Online执行此操作 但是我已经连接到远程会话并导入了exchange online模块,为什么它仍然抛出错误 $credential = Get-Credential $lyncSession = New-CsOnlineSession -Credential $credential $exchangeSession = New-PSSession -Configurati

我得到一个错误:

删除MsoLGroupMember:无法使用更新已启用邮件的组 此cmdlet。使用Exchange Online执行此操作

但是我已经连接到远程会话并导入了exchange online模块,为什么它仍然抛出错误

$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

我按照此链接设置与exchange的远程连接,但我一定是做错了什么

如果使用启用邮件的安全组,请改用Remove DistributionGroupMember,因为Remove MsoLGroupMember可用于常规安全组。
选中此项:

Remove MSOLGroupMember不是Exchange Online命令,这就是为什么会出现错误。您可以尝试使用Remove-DistributiongroupMember(不能100%确定这是否是特定的EXO cmdlet,我目前没有机器可以验证它)Remove-DistributiongroupMember似乎也不起作用。我得到一个错误,“GroupMailbox不支持当前操作。”正如我在对Seyam答案的评论中所述。那么它必须是一个unifiedgroup,它使用Remove UnifiedGroupLinks作为命令来删除groupmembers。请注意,Microsoft已明确记录了这一点,任何管理O365(尤其是使用Powershell)的人都应该知道组类型之间的差异以及如何管理它们。谢谢!我刚刚发现了那个资源!然而,关于这一点的另一个问题是,如何删除不知道自己是所有者还是成员的用户?由于使用remove unifiedgrouplins,您必须提供成员、所有者或订阅者的-LinkType。有什么想法吗?在这方面有两件事,1)我无法将GUID传递给identity参数,我收到一个错误(即使该链接说您可以传递它)2)当我尝试使用其他参数来标识组(如组电子邮件)时,我收到此错误,“GroupMailbox上不支持当前操作。”请在删除私人信息后共享您正在使用的脚本