How to fix Error Acquiring Token

Andrea Thiel 10 Reputation points
2025-01-13T15:53:39.0066667+00:00

I'm getting this error whenever i try to connect to Exchange online using PowerShell as Admin and I can't figure out how to fix it.

Error Acquiring Token:

Unknown Status: Unexpected

Error: 0xffffffff80070520

Context: (pii)

Tag: 0x21420087 (error code -2147023584) (internal error code 557973639)

OperationStopped: Unknown Status: Unexpected Error: 0xffffffff80070520 Context: (pii) Tag: 0x21420087 (error code -2147023584) (internal

error code 557973639)

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
Windows for business | Windows Server | User experience | PowerShell
{count} vote

3 answers

Sort by: Most helpful
  1. luis 85 Reputation points
    2025-02-07T13:11:43.85+00:00

    This error started to appear at version >= 3.7.0 Remove the version you have installed and try with version 3.6.0

    Uninstall-Module ExchangeOnlineManagement
    Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.6.0
    Get-InstalledModule ExchangeOnlineManagement
    

    Regards,

    17 people found this answer helpful.

  2. Anonymous
    2025-01-14T02:48:59.3833333+00:00

    Hi, @Andrea Thiel

    Based on your description, this looks like you're getting an error when connecting to Exchange Online PowerShell using the interactive interface.

    Here are some suggestions you can follow:

    1.Make sure you have installed the Exchange Online management module:

    Install-Module -Name ExchangeOnlineManagement 
    

    2.Use the following command to log in:

    Connect-ExchangeOnline -UserPrincipalName user@example.com -ShowProgress $true 
    

    More information can be found Connect to Exchange Online PowerShell | Microsoft Learn

    3.How did you get the token? See microsoft graph api - Could not login using access token from powershell - Stack Overflow

    4.If your organisation uses federation and your identity provider (IDP) and/or Security Token Service (STS) aren't publicly available, you can't use a federated account to connect to Exchange Online PowerShell.

    5.Make sure your root certificate is the latest certificate from a trusted authority. If you're using a self-signed certificate or a certificate from an internal CA, you need to trust that CA. You can import CA certificates into a trusted root certificate store.

    6.Enable TLS 1.2.

    7.Log in with a different administrator account to see if the problem persists.

    If an error occurs in the above steps, you can also attach a screenshot.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.