How to fix Error Acquiring Token

Andrea Thiel 5 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)

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,860 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,864 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,915 questions
{count} votes

3 answers

Sort by: Most helpful
  1. luis 50 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,

    10 people found this answer helpful.

  2. Ron-6928 31 Reputation points
    2025-03-03T19:37:43.01+00:00

    I started getting the same error after upgrading the module from version 3.1.0 to version 3.7.1.

    That error only happens when I launch PowerShell (Admin) or with admin permission. I manage to connect to Exchange Online Management without errors when I use PowerShell with a non admin account (regular user account).

    I didn't uninstall/reinstall the module. Just close PowerShell (Admin) and launch PowerShell. Yes I'm still using module v3.7.1.

    2 people found this answer helpful.

  3. Xintao Qiao-MSFT 6,595 Reputation points Microsoft External Staff
    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 [email protected] -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".


Your answer

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