Just a quick memory dump for myself really.
To export a report of all users from Office 365 and their associated licences run the following command in Azure Powershell Module
Get-MsolUser -All | Select UserPrincipalName, Licenses | fl | Out-File c:\office365users.txt
To only export licenced users
Get-MsolUser -All | Where {$_.IsLicensed -eq "True"} | Select UserPrincipalName, Licenses | fl | Out-File c:\office365users.txt
Mark is an Independent Microsoft Teams Consultant with over 15 years experience in Microsoft Technology. Mark is the founder of Commsverse, a dedicated Microsoft Teams conference and former MVP. You can follow him on twitter @UnifiedVale