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”
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"}'