Error Message When Attempting to Allow Legacy Exchange Tokens in Exchange Online

Sam Bennett 20 Reputation points
2025-02-04T17:12:57.5366667+00:00

I am attempting to allow legacy exchange tokens because an Outlook plug-in requires it. I am following the instructions outlined here: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/turn-exchange-tokens-on-off

After connecting to Exchange Online Management via PowerShell and running the command:

Set-AuthenticationPolicy AllowLegacyExchangeTokens -Identity "LegacyExchangeTokens"

I receive the following error:

Set-AuthenticationPolicy : A positional parameter cannot be found that accepts argument >'AllowLegacyExchangeTokens'. At line:1 char:1

  • Set-AuthenticationPolicy AllowLegacyExchangeTokens -Identity "LegacyE ...
  • CategoryInfo : InvalidArgument: (:) [Set-AuthenticationPolicy], >ParameterBindingException
    • FullyQualifiedErrorId : PositionalParameterNotFound,Set-AuthenticationPolicy

How can I allow legacy tokens if it will not let me?

Thank you!

Microsoft Exchange Online
Outlook
Outlook
A family of Microsoft email and calendar products.
4,439 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,463 questions
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,737 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,796 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alex Zhang-MSFT 4,740 Reputation points Microsoft Vendor
    2025-02-05T01:42:39.6933333+00:00

    Hello, @Sam Bennett

    Welcome to the Microsoft Q&A platform!

    According to the error message, there is an issue with your parameter. Please check it carefully in order not to miss any key point like "-".

    User's image

    After finishing this adjustment, you may run the cmdlet successfully. User's image

    Should you need more help on this, you can feel free to post back. 


    If the answer is helpful, please click on “Accept answer” as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions.

    Thank you for your support and understanding.

    Best Wishes,

    Alex Zhang

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Alex Sanger 0 Reputation points
    2025-02-05T09:23:18.93+00:00

    Can confirm - the command to enable legacy tokens is given correctly on the page OP referenced, but if you copy that command and paste it into PowerShell it drops the hyphen before the AllowLegacyExchangeTokens parameter. I didn't spot it until I read this article.

    Thanks!

    0 comments No comments

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.