Get a list of users whose license has expired

Tomass Pētersons 306 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?


Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,683 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 67,721 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

  2. soumi-MSFT 11,626 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.