SOLVED: PowerShell MFA Popup ‘We can’t sign you in. Javascript is required to sign in’

If you are seeing this message when working on a PowerShell script that is trying to connect to a Microsoft service requiring MFA (multi factor authentication), you may notice that the window is actually Internet Explorer:



The solution is to set all of the Microsoft pages to be Trusted Sites and then to set Trusted Sites to have low security in the Internet Explorer options.

  1. Launch Internet Explorer
  2. Click the SETTINGS COG icon in the top right corner
  3. Click INTERNET OPTIONS
  4. Click the SETTINGS tab
  5. Click TRUSTED SITES
  6. Click the SITES button
  7. Add *.microsoft.com and *.msftauth.net to the list, the click OK
  8. Drag the ALLOWED LEVELS FOR THIS ZONE to the lowest setting
  9. Click OK
  10. Try your PowerShell script again

Published by
Ian Matthews

This website uses cookies.