How to fix Error Acquiring Token

Andrea Thiel 0 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,702 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,775 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,762 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xintao Qiao-MSFT 6,030 Reputation points Microsoft Vendor
    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".


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.