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, Got the 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 winrm client cannot process the request basic authentication is currently disabled in the client configuration change the client configuration and try the request again

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: 

  • Open Registry Editor (RegEdit) as administrator and set the following Key: “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client”
  • Set “AllowBasic” value to “1”
  • Close and Re-Open PowerShell console (Sometimes works without reopening too!)The WinRM client cannot process the request basic authentication is currently disabled in the client configuration change

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