New-ExoPSSession : Connecting to remote server outlook.office365.com failed with the following error message : For more information, see the about_Remote_Troubleshooting Help topic.

Amin T 0 Reputation points
2023-07-27T09:54:13.4066667+00:00

Hello,

We're experiencing an issue with connecting to exchange online trough power-shell, it was sudden and was working fine before.

User's image

Can you please help ?

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Windows for business | Windows Server | User experience | PowerShell
{count} votes

3 answers

Sort by: Most helpful
  1. Kai Yao 37,766 Reputation points Moderator
    2023-07-28T02:41:18.1233333+00:00

    Hi @Amin T,

    From the screenshot you are using Exchange Online Powershell V2 module.

    The cause of this issue may be Remote Powershell is being deprecated and disabled in your tenant.

    For more details please refer to this blog:

    Deprecation of Remote PowerShell in Exchange Online – Re-enabling or Extending RPS support

    01

    Please update to Exchange Online PowerShell V3 module to see if it can work for you.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    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.

    1 person found this answer helpful.

  2. Limitless Technology 45,011 Reputation points
    2023-07-27T14:09:56.0033333+00:00

    Hello there,

    The error message you provided indicates that there is a problem connecting to the remote server "outlook.office365.com" using the New-ExoPSSession cmdlet. This cmdlet is used to create a remote PowerShell session to manage Exchange Online (Office 365) through PowerShell.

    Here are some common reasons and troubleshooting steps to resolve this issue:

    Check Internet Connectivity: Ensure that the machine where you are running the PowerShell script has an active internet connection. It needs to connect to Office 365 services via the internet.

    Firewall and Proxy Settings: Check if there are any firewall rules or proxy settings that might be blocking the PowerShell session from establishing a connection to the Office 365 servers. If there are any such restrictions, ensure that they allow traffic to outlook.office365.com.

    Module Installation: Make sure that you have installed the necessary PowerShell module to manage Exchange Online. The Exchange Online PowerShell module is required for the New-ExoPSSession cmdlet. You can download and install the module from the official Microsoft website.

    Authentication Issues: Ensure that you are using the correct credentials to connect to Exchange Online. The account you are using must have the necessary permissions to access Exchange Online. It's a good practice to use an account with Global Administrator or Exchange Administrator roles.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    Hope this resolves your Query !!

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

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

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