Connect-ExchangeOnline Error

Anonymous
2025-02-27T23:06:31+00:00

I have been trying to run Connect-ExchangeOnline from Powershell and got this error -

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)

I have MFA enabled in my account. Tried reinstalling Exchnageonline module, didn't work.

My powershell version is -

I can make it from my Hybrid joined laptop but not from MS Entra Joined laptop.

This worked when I signed in as local admin to the laptop

Microsoft 365 and Office | Install, redeem, activate | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2025-02-28T00:06:49+00:00

    Dear Mahza06,

    Thanks for updating! I'm so glad to hear that you have managed to fix the issue. I think your solution can help others who are facing the same situation, so I made some summary about the scenario:

    Symptom: Trying to run Connect-ExchangeOnline from Powershell and got this error -

    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)

    Solution:  Resolved by installing the PowerShell version 7.5.0 and running this command -

    Connect-ExchangeOnline -UserPrincipalName < > -device

    The information can provide much reference to other users in this forum, would you please help vote on this reply, so that others can see the information and get benefit from it. Thanks in advance!

    At this point, we highly appreciate your precious time and kind cooperation. Thank you.

    Sincerely,

    Microsoft Community Moderator

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2025-02-27T23:50:36+00:00
    1. Checked it already, none could fix the issue
    2. I have the version 5.1.26100.2161 installed
    3. I ran it as admin, didn't work
    4. Ran it from another MS Entra joined device and got the same error. But this worked from Hybrid joined device.
    5. IT Dept. isn't aware of any changes in permissions.

    Raised a ticket with MS Support Team, they got back to me saying they couldn't find anything wrong in the account settings and advised me to raise this with Windows Support as it's a separate team.

    I have fixed the error now.

    I have installed the PowerShell version 7.5.0 and ran this command -

    Connect-ExchangeOnline -UserPrincipalName < > -device

    that made the connection without any errors.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2025-03-03T01:35:41+00:00

    Dear Mahza06,

    Good day to you and hope you are doing well.

    If you don't mind, could you kindly submit your feedback and vote for my last reply. You could help any other community users who might be facing a similar scenario to easily find this thread/post. Thank you so much!

    We appreciate your time and kind cooperation. For other questions, feel free to add your post in the Microsoft Community team. Have a wonderful day!

    Sincerely,

    Microsoft Community Moderator

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2025-02-27T23:26:32+00:00

    Dear Mahza06,

    Good day! Thank you for posting to Microsoft Community. We are happy to assist you.

    It seems like you are encountering an issue with connecting to Exchange Online using PowerShell due to Multi-Factor Authentication (MFA) being enabled on your account. The error code you provided indicates a token acquisition problem.

    To resolve this issue, you can try the following steps:

    1. Please take this official article for reference: Connect to Exchange Online PowerShell | Microsoft Learn, it provides information on how to connect to Exchange Online PowerShell using the Exchange Online PowerShell module with or without multi-factor authentication (MFA).
    2. If you are using the Exchange Online PowerShell Module, make sure you have the latest version installed.
    3. Ensure that you are running PowerShell as an administrator.
    4. Try running the Connect-ExchangeOnline command from a different machine or PowerShell session to see if the issue persists.
    5. If you can connect from your Hybrid joined laptop but not from your MS Enterprise joined laptop, there may be a policy or configuration difference causing the issue. Check with your IT department for any restrictions on the MS Enterprise joined laptop.

    If the issue persists, since it's a compex admin task, we would suggest you contact Microsoft technical support team, this is a specific support channel for business admins. Please go to Office 365 Admin Center-> Support-> New Service Request. The support engineers there have the correct escalation channel, and this is the most efficient way to report such issue. You can refer to this article to check the way how to raise a ticket: Ways to contact support for business products - Admin help. The engineers in related team have higher permission and resources than us to help provide more professional information.

    Thank you for your time and cooperation.

    Sincerely,

    Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments