Get a list of users whose license has expired

Tomass Pētersons 336 Reputation points
2020-11-30T14:16:15.303+00:00

Hi,

Today our Covid-19 promo free E1 got expired, so lot of users now has invalid licenses. Is there any way we can get a list of all those users? Any PowerShell command or something?
0KQ26Rl.png

Thanks!

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,468 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 96,361 Reputation points MVP
    2020-11-30T14:29:42.763+00:00

    Maybe this is helpful:
    https://learn.microsoft.com/en-us/microsoft-365/enterprise/view-licensed-and-unlicensed-users-with-microsoft-365-powershell?view=o365-worldwide

    Get-MsolUser -All -UnlicensedUsersOnly  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

  2. soumi-MSFT 11,716 Reputation points Microsoft Employee
    2020-11-30T14:49:23.033+00:00

    Hello @Tomass Pētersons , thank you for reaching out. You can use the following PSCmdlets to fetch the list of users and check their license state and which licenses are assigned to them.

    Connect-MsolService  
    Get-MsolUser | Select DisplayName, UserPrincipalname, IsLicensed, Licenses  
    

    If you want to export the result in a .csv file just use the following cmdlet:

    Connect-MsolService  
    $path = "C:\temp\NoLicenseUsersList.csv"  
    Get-MsolUser | Select DisplayName, UserPrincipalname, IsLicensed, Licenses | Export-Csv -Path $path -NoTypeInformation -Append  
    

    Hope this helps.

    Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as an Answer; if the above response helped in answering your query.

    0 comments No comments