Changing PowerShell Scripts to Modern Authentication

Chris Kirschnick 26 Reputation points

Hi All,

Quite a newbie to PowerShell, so would appreciate some assistance with an existing script that I've been asked to changed to Modern Authentication.

I can see the line that I believe needs to be amended as the following:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Credential -Authentication Basic -AllowRedirection  

I've looked up some sites and pages (including the ones offered as I type this message). But as someone quite new to PowerShell, I don't know if they apply as the commands are somewhat different.

Happy to elaborate further, but please bare in mind my newness to the system. Thanks.

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.
3,688 questions
{count} votes

Accepted answer
  1. Aholic Liang-MSFT 12,866 Reputation points Microsoft Vendor

    Hi ,
    Do you mean you need to connect to Exchange Online PowerShell with modern authentication?
    If so, you could refer to this link to run ”Connect-ExchangeOnline” command to connect .

    In addition ,please make sure Windows PowerShell has EXO V2 module installed .
    About the Exchange Online PowerShell V2 module | Microsoft Learn

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 130.5K Reputation points MVP
    0 comments No comments