Hello Everyone
I am trying to export all users with specific licenses into a csv-file. Here is the command I've been trying to use:
Get-MsolUser -all | Select FirstName, LastName, DisplayName, City, Country, PrincipalName, Title, Department, Licenses | Where-Object {($_.Licenses).LicenseAssigned -match "PROJECTPROFESSIONAL" -or "PROJECTPREMIUM" -or "PROJECTESSENTIALS" -or "POWER_BI_PRO" } | export-csv C:\export5.csv -NoTypeInformation -Encoding UTF8 -Append
Unfortunately the export doesn't give me the licenses, only this entry: System.Collections.Generic.List`1[Microsoft.Online.Administration.UserLicense]
What am I doing wrong? My goals is to see all the details I mentioned plus if they are using the licenses, which of the licenses they are having.
Thank you for your Help.
Kind regards,
Gabriel