使用 powershell 连接到交换服务器

Connecting to exchange server with powershell

我正在尝试连接到我的交换服务器(目前使用 o365+exchange 的混合构建)

$usercredential = Get-Credential
$session = New-PSSession -ConfigurationName microsoft.exchange -connectionuri https://outlook.office365.com/powershell-liveid/ -Credential $usercredential -Authentication basic -AllowRedirection
Import-PSSession

使用它时我可以连接,但是它会 return

cmdlet Import-PSSession at command pipeline position 1
Supply values for the following parameters:
Session: 

我已经通过 get-help 了,但运气不佳,但无论输入什么都会 return 错误

Import-PSSession : Cannot bind parameter 'Session'. Cannot convert the "" value of type "System.String" to type 
"System.Management.Automation.Runspaces.PSSession".

我忽略了什么?

编辑:

$cred = Get-Credential
$s = New-PSSession -ConfigurationName "Microsoft.Exchange" -ConnectionUri "https://ps.outlook.com/powershell/" -Credential $cred -Authentication Basic -AllowRedirection
Import-Module o365
Get-mailbox | Get-MailboxPermission -ResultSize 10000

使用它我能够绕过使用 exchange 并仅与 o365 通信并获得我正在寻找的详细信息。