New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message: The WinRM client cannot process the request. Basic authentication is currently disabled in the client configuration. Change the client configuration and try the request again

Problem: When trying to connect to Exchange Online through PowerShell, I got this error message:
“New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : The WinRM client cannot process the request. Basic authentication is currently disabled in the client configuration. Change the client configuration and try the request again. For more information, see the about_Remote_Troubleshooting Help topic.”

The script I used to connect to Exchange Online:

#Get Credentials to connect
$Credential = Get-Credential
 
#Create the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange `
    -ConnectionUri https://outlook.office365.com/powershell-liveid/ `
    -Credential $Credential `
    -Authentication Basic -AllowRedirection
 
#Import the session
Import-PSSession $Session

Solution:

Confirmed the user is already a member of the “Organization Management” Admin role in Exchange. Resolved the issue by making the below registry change:

  • Open Registry Editor (RegEdit) as administrator and set the following Key: “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client” (Create the key, if it doesn’t exists!)
  • Set “AllowBasic” value to “1”
  • Close and Re-Open PowerShell console (Sometimes works without reopening too!)

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply

Your email address will not be published.