Error when connecting to Exchange Online via Powershell

User445 26 Reputation points
2022-08-19T06:54:57.627+00:00

Hi Guys,

for a few weeks now, we are getting an error when trying to connect to ExchangeOnline with the Powershell Console.
This question "https://learn.microsoft.com/en-us/answers/questions/912371/exchange-online-ps-error.html" is similar/equal to our problem, but so far it didnt work.
In the past our commands worked without problems, but suddenly it fails.
Here is a Screenshot of the Error and some other things I checked from the question above:
232745-errorps.png

When I enter the this line "Connect-ExchangeOnline -UserPrincipalName admin@keyman .onmicrosoft.com" a microsoft window pops up and asks me for my password.
I enter the password and then i get the error message.

Do you guys have any tipps, that I should try?
If you need some more informations, just let me know.

Thanks

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

Accepted answer
  1. Morten Skrubbeltrang 156 Reputation points
    2022-08-22T12:36:22.043+00:00

    Hi, please try to make sure TLS 1.2 is enabled for the .Net Framework by checking/setting the following registry keys:

     Windows Registry Editor Version 5.00  
          
     [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]  
     "SystemDefaultTlsVersions"=dword:00000001  
     "SchUseStrongCrypto"=dword:00000001  
          
     [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]  
     "SchUseStrongCrypto"=dword:00000001  
     "SystemDefaultTlsVersions"=dword:00000001  
    

    (ref. https://www.easy365manager.com/knowledgebase/aadsts1002016-you-are-using-tls-version-1-0-1-1-and-or-3des-cipher/)

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Limitless Technology 44,766 Reputation points
    2022-08-19T14:44:09.557+00:00

    Hi,

    Please try using your real domain as the username rather than the onmicrosoft version. This could make a difference.

    I hope this answers your question.

    Thanks.

    ---

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

    0 comments No comments

  2. User445 26 Reputation points
    2022-08-22T06:37:08.49+00:00

    Hi,

    thanks for your answers.
    I will try the things I can do today.
    I will give you an update once I am finished with testing.

    UPDATE:
    I tested with my personal Domainaccount, which is also member of "Global Administrator".
    I get this error message:

    Error Acquiring Token:
    AADSTS1002016: You are using TLS version 1.0, 1.1 and/or 3DES cipher which are deprecated to improve the security postur
    e of Azure AD. Your TenantID is: XXXXX. Please refer to https://go.microsoft.com/fwlink/?
    linkid=2161187 and conduct needed actions to remediate the issue. For further questions, please contact your administrat
    or.
    Trace ID: a41687bc-XXXXX
    Correlation ID: 7358ce47-dc12-4c2d-XXXXX
    Timestamp: 2022-08-22 07:20:41Z
    New-ExoPSSession : Mindestens ein Fehler ist aufgetreten.
    In C:\Program
    Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5\netFramework\ExchangeOnlineManagement.psm1:475
    Zeichen:30

    • ... PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro ...
    • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [New-ExoPSSession], AggregateException
    • FullyQualifiedErrorId : System.AggregateException,Microsoft.Exchange.Management.ExoPowershellSnapin.NewExoPSSess
      ion

    The command "Get-ExOMailbox" I cannot run, because it says:

    Get-ExOMailbox : You must call Connect-ExchangeOnline before calling any other cmdlet.

    The Basic Authentication is enabled.
    And we do not use a proxy.
    Security Defaults are in AAD disabled.
    The Client where I am trying the connection from, is the Exchange Hybrid Server (Server 2016) itself.

    Now the error message at least tells me something.
    I will read the microsoft manuell and hope that I can fix the error this way.

    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.