Get a list of users whose license has expired

Tomass Pētersons 336 Reputation points


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?


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

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 95,336 Reputation points MVP

    Maybe this is helpful:

    Get-MsolUser -All -UnlicensedUsersOnly  


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

    Andreas Baumgarten

    0 comments No comments

  2. soumi-MSFT 11,716 Reputation points Microsoft Employee

    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.

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

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

    $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