Hello,
Thanks for reaching out,
Get-MsolUser -All | Where-Object {($_.licenses).AccountSkuId -match "ENTERPRISEPREMIUM"} | ft
--To list all users using (consuming) a specific licensing plan, use the following command:
Get-Mailbox -ResultSize unlimited | Format-Table DisplayName,
--To get all Mailboxes
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName,LastLogonTime
--To bet all mailboxes lastaccess or last logon time
Hope this helps.