术语 'remove-distributiongroupmember' 未被识别为 cmdlet 的名称

The term 'remove-distributiongroupmember' is not recognized as the name of a cmdlet

对于 powershell 中的这个错误,必须导入哪些模块?

The term 'remove-distributiongroupmember' is not recognized as the name of a cmdlet, function, script file, or operable program.

Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Connect to Exchange Online PowerShell

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

#Your code here

Remove-PSSession $Session

Connect to Exchange servers using remote PowerShell

注意:将 mailbox01.contoso.com 替换为您自己的交换服务器。

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://mailbox01.contoso.com/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $Session

#Your code here

Remove-PSSession $Session