Export a list of Office 365 users with their assigned licenses using PowerShell

Connect to Exchange Online:

Connect-ExchangeOnline

Retrieve Users with Licenses:

Use the Get-MsolUser cmdlet to retrieve a list of all users in your Office 365 organization. Then, use the Select-Object cmdlet to filter the results to only include users with licenses.

Get-MsolUser | Select-Object UserPrincipalName, AssignedLicenses
Get-MsolUser | Select-Object UserPrincipalName, AssignedLicenses | Export-Csv -Path "C:\Users\Public\Office365UsersWithLicenses.csv" -NoTypeInformation

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Journey Blog by Crimson Themes.