unable to access EXO powershell

Shahin Mortazave 491 Reputation points
2022-04-15T13:46:11.347+00:00

Hi guy's
I am having a problem to connect to exchange online form PowerShell on a server 2012.
When try to connect get this error: Connecting to remote server outlook.office365.com failed The SSL connection cannot be established
I made sure that the TLS 1.1 and 1.2 are enabled and I can access the outlook.office365.com from IE browser but when try to access the Exchange online get this error.

Any suggestion?

Thanks

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,633 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,709 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Vasil Michev 110.2K Reputation points MVP
    2022-04-15T14:22:46.183+00:00

    PowerShell uses .Net settings for TLS, so check for that:

    [Net.ServicePointManager]::SecurityProtocol
    

    and if needed, update via:

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    

  2. Shahin Mortazave 491 Reputation points
    2022-04-19T08:57:18.307+00:00

    @Vasil Michev , Thanks for your reply, I just check the registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\ and there I can see the
    TLS 1.2\Clients and a registry key DisabledByDefault withy the value of 1 I set it to 0 but still unable to connect to the exchane online.
    Do we need to add the server key and DisabledByDefault to 0? or that is noet needed?

    0 comments No comments

  3. KyleXu-MSFT 26,276 Reputation points
    2022-04-20T08:51:25.63+00:00

    @Shahin Mortazave

    Follow this article to set ExecutionPolicy as RemoteSigned, make sure basic enabled on your computer:

    Set-ExecutionPolicy RemoteSigned  
    winrm get winrm/config/client/auth  
    

    About managing TLS, you could follow this blog.

    You also need to make sure Exchange Online IP address could be accessed from your client.


    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.



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.