Documentation
Install O365Essentials
Install O365Essentials from PowerShell Gallery.
Install O365Essentials from PowerShell Gallery:
Install-Module -Name O365Essentials -Scope CurrentUser -AllowClobber
Import the module and connect interactively:
Import-Module O365Essentials
Connect-O365Admin -Verbose
Prefer PowerShell 7 or newer so REST errors are easier to read.