我正在尝试通过 PowerShell 连接到 Microsoft Exchange,但我不断收到“拒绝访问”错误。我正在使用具有营业执照的全局管理员进行连接,所以这不应该是问题。
我运行的命令:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
错误信息:
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : Access denied. For more information, see the about_Remote_Troubleshooting Help topic. At line:1 char:12 $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ... + CategoryInfo: OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed