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."

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!)
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 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 Reviewed by Salaudeen Rajack on August 05, 2018 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.