Office 365-使用PowerShell WinRM连接到Exchange问题

Office 365-使用PowerShell WinRM连接到Exchange问题,powershell,office365,Powershell,Office365,我正在尝试联机连接到O365 Exchange,但执行此操作时收到WinRM错误消息 $user = "user@domain.co.uk" $cred = Get-Credential -Credential $user $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/"

我正在尝试联机连接到O365 Exchange,但执行此操作时收到WinRM错误消息

$user = "user@domain.co.uk"
$cred = Get-Credential -Credential $user

$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $cred -Authentication "Basic" -AllowRedirection
运行时,我收到以下错误消息:

> New-PSSession : [outlook.office365.com] Connecting to remote server
> outlook.office365.com failed with the following error message : The
> WinRM client cannot process the request. Basic authentication is
> currently disabled in  the client configuration. Change the client
> configuration and try the request again. For more information, see the
> about_Remote_Troubleshooting Help topic. At line:1 char:20
> + $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -Connecti ...
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession],
> PSRemotingTransportException
>     + FullyQualifiedErrorId : -2144108321,PSSessionOpenFailed
我在网上浏览了WinRM和基本身份验证。 我已经通过GPO启用了基本身份验证,但这并没有起到多大作用

任何信息都很好


谢谢

在我看来,您已经为管理员帐户启用了MFA-禁用它。干杯。

我可以通过Powershell连接到O365管理门户和SharePoint,这毫无价值。在启用Azure MFA的情况下:您可以使用应用程序密码。