Connecting to remote server outlook.office365.com failed with the following error message

shashidhar joliholi 246 Reputation points
2021-05-25T15:30:14.607+00:00

Hi All,

I have installed the Exchange Online Management V2 2.0.3 version on Windows server 2016. When i tries Connect-Exchange Online gets the prompt for credential and MFA. post that getting following error.

99575-exoerrorpowershell.png

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,041 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 90,631 Reputation points MVP
    2021-05-25T19:43:01.14+00:00

    Run winrm /quickconfig and make sure your firewall is not blocking connections to Exchange Online (here's the list of IPs/URLs you need to allow: https://learn.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges?view=o365-worldwide#exchange-online)

    0 comments No comments

  2. KyleXu-MSFT 26,196 Reputation points
    2021-05-26T09:07:46.32+00:00

    @shashidhar joliholi

    Try to ping "outlook.office365.com" first, make sure you could access this address from your computer.

    Then try to update the version of Exchange Online Management:

    Update-Module -Name ExchangeOnlineManagement  
    

    After that, connect to Exchange online again. Make sure your tenant is worldwide version, if you are using other version of Office 365, you need to connect to it with other command:
    99806-qa-kyle-17-06-46.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments