O365_connect

Description

PowerShell for Microsoft 365 lets you manage your Microsoft 365 settings from the command line. Connecting to PowerShell is a simple process where you install the required software and then connect to your Microsoft 365 organization.


Install MSonline Module

ps>Install-Module MSOnline

Connect to the office 365 tenant

ps>Connect-MsolService

Connect to ExchangeOnline

Install prerequis

source install

ps>Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.3

Allow script execution

ps>Set-ExecutionPolicy unrestricted

Connect exchange online witout MFA

ps>
Import-Module ExchangeOnlineManagement
$UserCredential = Get-Credential
Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true

Try the connexion

ps>Get-Mailbox

Source :

exchange connect

m365 connect


Date : 2020.10.13