Perform these commands once:
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement
Then whenever you want to connect:
Connect-ExchangeOnline
PowerShell script example to obtain which mailboxes User Bill Smith has access to:
get-Mailbox -Resultsize Unlimited | Get-MailboxPermission -User bill.smith | ? {$_.AccessRights -match "FullAccess" -and $_.IsInherited -eq $False} | get-mailbox | select identity,primarysmtpaddress