我正在尝试连接到我的交换服务器(目前正在使用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".
我在俯瞰什么?
$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沟通,并获得我正在寻找的细节。