Troubleshooting “New-ExoPSSession : Create Powershell Session is failed using OAuth”

This is a post in a series of blog articles about troubleshooting typical error situations in PowerShell cmdlets in the cloud. This time it’s about…

Connect-ExchangeOnline / Connect-IPPSSession

Maybe you want to use the Exchange Online PowerShell module or the Security and Compliance Center Powershell Module. You try to use the appropriate cmdlets Connect-ExchangeOnline or Connect-IPPSSession. If you get an error message like “New-ExoPSSession : Create Powershell Session is failed using OAuth”

Screenshot with a error message of the PowerShell cmdlet Connect-ExchangeOnline

This is because you try to install the connect to the Microsoft cloud backend, and your Powershell remoting has the basic auth disabeld. But for connections with Connect-IPPSSession, you have to ensure that basic auth is enabled (which is the default setting for the Windows remote management configuration).

You should check what is the current config status for WinRM Basic Auth, and enable it if needed. You can use these commands:

winrm get winrm/config/client/auth

winrm set winrm/config/client/auth '@{Basic="true"}'
Screenshot with WinRM commands to enable basic auth in remote PowerShell sessions

Leave a Reply

Your email address will not be published. Required fields are marked *