New-ExoPSSession: Create Powershell Session is failed using OAuth

New-ExoPSSession Error Message

In some cases, you’ll see the following error message when using PowerShell to connect with Exchange Online:

New-ExoPSSession : Create Powershell Session is failed using OAuth
At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5\
  netFramework\ExchangeOnlineManagement.psm1:475 char:30
+ ... PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : NotSpecified: (:) [New-ExoPSSession], Exception
  + FullyQualifiedErrorId : System.Exception,

This error message is somewhat misleading as it doesn’t reflect the actual cause of the problem.

To fix this you must ensure that WinRM client basic authentication is enabled.

Go to this article to verify if this is the cause of the error message and see how you fix it.