Forum Discussion
Exception: Microsoft.Online.Administration.Automation.MicrosoftOnlineException
Thank you, Vasil!
Well! To check if anything blocking the HTTP traffic, I tried to log in using office 365 services using IE and it's working fine.
I will try to remove and reinstall MSOnline module and try again.
-- Rahul
Thank you!
I finally figured out the issue. I checked the log again and find below error message --
System.Net.WebException - The remote server returned an error: (407) Proxy Authentication Required.
Proxy was rejecting the PowerShell Web request. The issue got fixed after setting the proxy using below commands
1. netsh winhttp show proxy
Check the current proxy setting
netsh winhttp import proxy source=ie
Set the IE as a source for proxy
-- Rahul
- tsullivanFeb 27, 2019Copper Contributor
This fixed mine
https://www.crammysblog.com/the-pain-of-tls-1-2-with-powershell-module-for-azure-active-directory-msonline/
Really stupid issue, having to force TLS 1.2
- iamireshJan 08, 2024Copper ContributorThis fixes mine also.
- DarrickFeb 27, 2019Brass Contributor
Thanks for sharing this tip.
- tsullivanFeb 28, 2019Copper Contributor
It worries me putting in a reg key like that, as what happens oneday when something else changes and this 'custom fix' breaks something new. As built doco reflects this for us now to reference, but this seems unworkable from microsoft on a large scale.