To get the licenses assigned to a user in Microsoft Office 365 with PowerShell, you can use the following command.
Get-MsolUser -UserPrincipalName "[email protected]" | Select-Object DisplayName, Licenses
In the above PowerShell script, the Get-MsolUser command retrieves the licenses assigned to a user from the Azure Active Directory (AD).
UserPrincipalName parameter specifies the user ID of the user that you want to retrieve the licenses for.
The output of the above PowerShell script output displays the name and licenses assigned to the user [email protected].
Licenses property displays a list of the user’s licenses assigned in Office 365, in the above case ENTERPRISEPACK or Office 365 E3 license assigned to the user.
Cool Tip: How to get Office 365 users with license type with PowerShell!
I hope the above article on how to get Office 365 licenses assigned to a user using PowerShell is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.