当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] New-ExoPSSesion:连接到远程服务器outlook.office365.com失败

作者:精品下载站 日期:2024-12-14 13:36:09 浏览:15 分类:玩电脑

New-ExoPSSesion:连接到远程服务器outlook.office365.com失败


[玩转系统] New-ExoPSSesion:连接到远程服务器outlook.office365.com失败

在某些情况下,使用 EXO2 PowerShell 模块连接到 Exchange Online 时您会看到以下错误消息:

New-ExoPSSession : Connecting to remote server outlook.office365.com failed with the following error message :
The client cannot connect to the destination specified in the request.
Verify that the service on the destination is running and is accepting requests.
Consult the logs and documentation for the WS-Management service running on the destination,
most commonly IIS or WinRM.
If the destination is the WinRM service, run the following command on the destination to analyze and configure
the WinRM service: "winrm quickconfig".
For more information, see the about_Remote_Troubleshooting Help topic.

请访问微软的云Exchange环境并检查WS-management服务是否正在运行! ?

与此错误消息所指示的相反,您自然应该在本地系统上查找错误原因。

您的系统无法完成连接请求的原因可能有多种。

问题之一可能是无效的代理设置。例如,如果您正在使用 Fiddler 或其他工具并设置本地代理设置,您可能会意外阻止 EXO 连接请求。

使用以下命令检查是否存在虚假代理设置:

PS C:\> netsh winhttp show proxy

Current WinHTTP proxy settings:

    Proxy Server(s) :  localhost:8888
    Bypass List     :  (none)

如果您发现任何(无效)活动代理设置,可以使用以下命令清除它们:

PS C:\> netsh winhttp reset proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

PS C:\> netsh winhttp show proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

完成这些设置后,您应该可以恢复正常工作了:

PS C:\WINDOWS\system32> Connect-ExchangeOnline

----------------------------------------------------------------------------
The module allows access to all existing remote PowerShell (V1) cmdlets in addition to
the 9 new, faster, and more reliable cmdlets.

|--------------------------------------------------------------------------|
|    Old Cmdlets                    |    New/Reliable/Faster Cmdlets       |
|--------------------------------------------------------------------------|
|    Get-CASMailbox                 |    Get-EXOCASMailbox                 |
|    Get-Mailbox                    |    Get-EXOMailbox                    |
|    Get-MailboxFolderPermission    |    Get-EXOMailboxFolderPermission    |
|    Get-MailboxFolderStatistics    |    Get-EXOMailboxFolderStatistics    |
|    Get-MailboxPermission          |    Get-EXOMailboxPermission          |
|    Get-MailboxStatistics          |    Get-EXOMailboxStatistics          |
|    Get-MobileDeviceStatistics     |    Get-EXOMobileDeviceStatistics     |
|    Get-Recipient                  |    Get-EXORecipient                  |
|    Get-RecipientPermission        |    Get-EXORecipientPermission        |
|--------------------------------------------------------------------------|

To get additional information, run: Get-Help Connect-ExchangeOnline or check
https://aka.ms/exops-docs

Send your product improvement suggestions and feedback to [email protected].
For issues related to the module, contact Microsoft support.
Don't use the feedback alias for problems or support issues.
----------------------------------------------------------------------------

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯