To manage your O365 exchange organisation powershell has to connect to the online service but this is not the same as connecting to Azure AD through powershell where the connect-msolservice cmdlet is used.
To connect to exchange online:
cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic –AllowRedirection
Import-PSSession $Session
I needed to fetch the number of items and mailbox size of a few users which I used the get-mailboxstatistics command for:
get-mailboxstatistics -identity user@domain.com | fl itemcount, totalitemsize
This information is not available through the O365 portal, at least the number of items isn’t anyway.
The Exchange powershell cmdlets are downloaded automatically when making the connection they don’t need to be installed on the machine making the connection.