Get a list of users and which licenses they’ve got assigned. First connect to the Microsoft Online environment.
# Import the MSOnline module.
# Capture administrative credentials.
$Credential = Get-Credential
# Establishes Online Services connection to Azure Active Directory.
Connect-MsolService -Credential $Credential
Run the script and find out…