This article describes the procedure of connecting PowerShell to Office 365 in order to manage the Cloud via CMDLET
Prerequisites:
- PowerShell version 7.2 or higher
- A valid Global Administrator account in Office 365 Exchange Online
Procedure:
- Allow execution Policy to remotesigned
Set-ExecutionPolicy RemoteSigned
- Set minimum TLS Protocol to TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- Install necessary Modules for PowerShell: AzureAD, MSOnline, Exchange Online Management
Install-Module AzureAD
Install-Module MSOnline
Install-Module -Name Exchangeonlinemanagement
- Import the installed modules
Import-Module AzureAD
Import-Module MSOnline
Import-Module -Name Exchangeonlinemanagement
- Connect to ExchangeOnline
Connect-ExchangeOnline
Note: A browser login windows will pop-up. Use your global admin credentials and close the pop-up window. You are logged in now: