使用PowerShell连接到Exchange服务器

问题描述 投票:0回答:1

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

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

使用它时,我能够连接,但它会返回

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

我已经通过get-help而没有太多运气,但输入的任何内容都将返回错误

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

我在俯瞰什么?

编辑:enter image description here

powershell exchange-server
1个回答
0
投票
$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

使用这个我能够绕过使用交换,只是与o365沟通,并获得我正在寻找的细节。

© www.soinside.com 2019 - 2024. All rights reserved.