MFA enabled account Exchange Online Powershell automation with tokens

Nikita Krivets 486 Reputation points
2019-12-10T14:18:06.833+00:00

Hello,

I was told to put my question here. Just in case here is the link for my previous question.
https://answers.microsoft.com/en-us/msoffice/forum/all/mfa-enabled-account-exchange-online-powershell/08a8f9f9-163f-44a4-a566-1bb3e4d6eaab

I need to automate my Exchange Online Powershell Tasks using an MFA enabled user account.

Firstly, I entered my credentials and proceed with MFA to get an Access Token and a Refresh Token. Secondly, I opened my Exchange Online Powershell session (https://outlook.office365.com/PowerShell-LiveId?BasicAuthToOAuthConversion=true) with the Access Token as a password for my * Email address is removed for privacy *. Now the session is established. Next time I want to open a session, I am to use my previously acquired Refresh Token to get a new Access Token and so on.

Is it a proper way to automate my tasks?

Thanks in advance.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,184 questions
{count} votes

Accepted answer
  1. FrankHu-MSFT 976 Reputation points
    2019-12-11T18:49:10.057+00:00

    I see, so you want to consistently refresh the token? Unfortunately this is not supported, per the github issue here : https://github.com/MicrosoftDocs/office-docs-powershell/issues/3351

    If you're interested in this feature, I suggest submitting an issue against here : https://github.com/MicrosoftDocs/office-docs-powershell/issues/new

    And if there's enough community support the product team will look into implementing this feature accordingly. Thanks for your feedback!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful