How to connect & install Exchange online PowerShell
For Windows
All versions of the module are supported in Windows PowerShell 5.1.
PowerShell 7 on Windows requires version 2.0.4 or later.
Version 2.0.5 or later of the module requires the Microsoft .NET Framework 4.7.2 or later to connect.
Otherwise, you get a System.Runtime.InteropServices.OSPlatform error.
Prerequisites for the Exchange Online PowerShell module
Set the PowerShell execution policy to RemoteSigned To require all PowerShell scripts that you download from the internet are signed by a trusted publisher,
run the following command in an elevated PowerShell window (a PowerShell window you open by selecting Run as administrator):
1. Set-ExecutionPolicy RemoteSigned
2. In an elevated PowerShell window (all users):
a. Install-Module -Name ExchangeOnlineManagement
3. connect-exchangeonline
4. Do the authentication if MFA is enabled, input the code.
As of April 2020, the PowerShell Gallery only supports connections using TLS 1.2 or later.
To check your current settings in the Microsoft .NET Framework, run the following command in Windows PowerShell: It will tell us the TLS version.
1. [Net.ServicePointManager]::SecurityProtocol
Tip: Version 3.0.0 and later (2022) is known as the Exchange Online PowerShell V3 module (abbreviated as the EXO V3 module).
Version 2.0.5 and earlier (2021) was known as the Exchange Online PowerShell V2 module (abbreviated as the EXO V2 module).
Article: About the Exchange Online PowerShell V3 module | Microsoft Learn