An error occurred while sending the request.

Sunil Kumar Thodupunooru 0 Reputation points
2023-04-03T02:49:12.9566667+00:00

Hi,

I am receiving the below error when I try to execute a PowerShell command from a Windows Server.

Command: connect-exchangeonline

Error:

An error occurred while sending the request.
At C:\Program Files\WindowsPowerShell\Modules\exchangeonlinemanagement\netFr
char:21
+                     throw $_.Exception.InnerException;
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], HttpRequestException
    + FullyQualifiedErrorId : An error occurred while sending the request.

Appreciate any help I can get.

Thanks,

SK

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,181 questions
Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,766 Reputation points
    2023-04-03T12:45:51.7166667+00:00

    Hello there,

    The error message tends to suggest you can;t connect to EOL. That could be because of a bad password.

    One trick that sometimes works - use the -Verbose switch - it can give you more details as to what went wrong.

    Any chance a corporate security product is blocking it, say something like zscaler for traffic filtering on the network level, or local AV product?

    The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.

    https://learn.microsoft.com/en-us/answers/questions/912371/exchange-online-ps-error

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

  2. Amit Singh 5,306 Reputation points
    2023-04-05T08:59:26.2+00:00

    Try to connect to Exchange Online with the command below: Connect-ExchangeOnline -UserPrincipalName ******@domain.onmicrosoft.com If there exists an issue with it, I would suggest you use the command below to uninstall Exchange online module and reinstall it (Run those command in an elevated PowerShell window): Uninstall-Module -Name ExchangeOnlineManagement Install-Module -Name ExchangeOnlineManagement   For EXO V2 module 2.0.5, you also need to check the setting below: ExecutionPolicy set as "RemoteSigned": Set-ExecutionPolicy RemoteSigned Basic is enabled on the client: winrm get winrm/config/client/auth For more detailed information, check this article - have a look about this article.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.