Scenario
While running the setup wizard, users may encounter Error 50199 in the Azure sign-in logs when attempting to connect via Microsoft Exchange REST API–based PowerShell. The connection fails, and the logs indicate that Microsoft is prompting the user to confirm access to the Microsoft Exchange Online Remote PowerShell app.
Reason
For security purposes, Microsoft requires user confirmation for this sign-in request.
Error 50199 occurs when the confirmation is incomplete or blocked. Additionally, authentication failures can happen if the Global Admin privileges are assigned indirectly via group membership rather than directly to the user. Conditional Access policies are typically not the cause in this scenario.
Resolution
Verify how Global Admin rights are assigned to the affected account.
If the account receives Global Admin privileges through a group, reassign the role directly to the user account.
After updating the assignment, rerun the Connect to Microsoft 365 process using the same account.