these often occurs due to issues with the authentication process or network connectivity.
Error while connecting to MSOLService, Teams and IPPSsession using basic auth
While connecting to the MSOL service, Teams and IPPSSession using the powershell with Basic Auth(MFA disabled and necessry roles added), facing the below issue
Commands Ran:
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $username, $(convertto-securestring $password -asplaintext -force)
Connect-IPPSSession -Credential $cred
Connect-MsolService -Credential $cred
"errorMessage":"An error occurred while sending the request.","errorStackTrace":" at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Identity.Core.Http.HttpManager.<ExecuteAsync>d__9.MoveNext() in D:\\a\\1\\s\\src\\Microsoft.IdentityModel.Clients.ActiveDirectory\\Core\\Http\\HttpManager.cs:line 235\r\n--- End of stack trace from previous location "
Can anybody please help us in resolving this issue
Microsoft Teams
PowerShell
Microsoft Entra ID
2 answers
Sort by: Most helpful
-
-
Brian Zarb 1,670 Reputation points
2023-08-08T06:25:40.9566667+00:00 Instead Install the Azure module (install-module) and use the Connect-AzureAD to connect, here is how i typically do it:
$securepass = ConvertTo-SecureString "Plainpassword" -AsPlainText -Force Connect-AzureAD -Credential (new-object system.management.automation.PScredential("******@email.com",$securepass)) -showbanner:$false
This has worked several time for me , hopefully it does for you to.
If you find this helpful, consider leaving a thumbs up and mark as your answer.