Get connection closed by remote host after executing Connect-ExchangeOnline PoweShell

Pradeep Vaishya 0 Reputation points
2024-03-20T06:14:58.3766667+00:00

Hello Team,

 

I've imported the Exchange Online PowerShell module to connect with the Exchange portal for performing Exchange-related activities. However, after MFA (Multi-Factor Authentication), we're encountering the attached response. Could you please assist us with this issue?

User's image

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,386 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jake Zhang-MSFT 3,510 Reputation points Microsoft Vendor
    2024-03-20T09:24:38.8966667+00:00

    Hi Pradeep Vaishya,

    Based on the information you posted the image with, I think this is due to a network issue or a configuration issue, I suggest you follow the steps below to check the cause of the issue:

    1. Make sure your PowerShell environment is updated to the latest version.
    2. Ensure that you are using an Exchange Online PowerShell module that supports MFA, such as using the Connect-ExchangeOnline command.
    3. Check your network connection to ensure that there are no firewalls or network policies blocking the connection.
    4. Try clearing old PowerShell sessions or restarting PowerShell.
    5. Check your authentication policy and permissions to ensure that your account is authorized to perform these actions.
    6. If the problem persists, try connecting using the -Verbose parameter in PowerShell, which may provide additional error messages.