The problem
The administration shell opens a browser sign-in window, accepts valid credentials, and then returns to the same authentication prompt. The visible error is generic enough to send troubleshooting in several unhelpful directions.
Symptoms
- Interactive authentication succeeds in the browser but not in the shell.
- The failure affects one workstation, not every administrator.
- A clean shell profile does not change the result.
- The module was updated recently, but an older copy is still present.
Environment
This demonstration assumes PowerShell 7 on a managed workstation. Start by recording versions instead of changing anything:
$PSVersionTable.PSVersion
Get-Module ExchangeOnlineManagement -ListAvailable |
Select-Object Name, Version, PathThe fix
For this fictional case, the actual cause was an outdated module path loading ahead of the expected installation. The useful lesson is the sequence: inspect, confirm the loaded path, then make the smallest reversible correction.
Get-Module ExchangeOnlineManagement | Format-List Name, Version, Path
# Demo only: compare the loaded module path with your approved installation.Why it works
PowerShell can discover more than one installed version of a module. A successful update does not automatically prove that the current session loaded the expected copy. Looking at the resolved path tests the assumption directly.
Notes and gotchas
If the loaded path is correct, stop and revisit the evidence. Conditional Access, proxy behavior, account scope, and device policy can produce similar symptoms.
References
Use the current Exchange Online PowerShell documentation as the authoritative reference.