Install PowerShell
sudo apt-get update; sudo apt-get install -y wget apt-transport-https software-properties-common; wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb; sudo dpkg -i packages-microsoft-prod.deb; sudo apt-get update; sudo apt-get install -y powershell; sudo pwsh
Connect to Microsoft 365
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name PSWSMan -Scope AllUsers;
Install-WSMan;
Install-Module -Name ExchangeOnlineManagement;
Import-Module ExchangeOnlineManagement;
Connect-ExchangeOnline -Device;
Get-EXOMailbox | FT
5/5 - (2 votes)