PowerShell MFA opens browser instead of mini-browser

David Dawson 100 66 Reputation points
2024-04-17T13:58:24.7133333+00:00

Recently I reset my Windows 11 PC and also upgraded to PowerShell 7.4.2. Something is now causing any MFA sessions in PowerShell to launch a new tab in my default browser rather than opening a mini-browser to handle the modern authentication. It should be popping up a window as described in the Exchange Online article but it's opening the browser instead. It's really just an annoyance because my default browser can accumulate multiple sign-ins rather than just my daily user account.

This is pretty hard to even search for because the keywords I'm using are so general. I can't find a solution or even others who have this problem. How do I make PowerShell return to the behavior to open the mini-browser rather than a new tab in my browser? I might just reset my PC again!

https://learn.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-powershell?view=exchange-ps

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,068 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,811 Reputation points Microsoft Vendor
    2024-04-18T02:14:14.8066667+00:00

    Hi David Dawson 100

    According to the link in your post, in PowerShell 7, browser-based single sign-on (SSO) is used by default, so the sign-in prompt opens in your default web browser instead of a standalone dialog. So I think it's an expected behavior to open your browser in PowerShell 7 and you can keep running the script in Windows PowerShell 5.1 if you still want to use the standalone dialog.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments