none
o365 licenses question RRS feed

  • Question

  • Kinda new to powershell.

    I’m trying to get a list of o365 users that have an enterprise pack license.

    So I started with this command:

    Get-MsolUser -UserPrincipalName <user> | Format-List DisplayName,licenses

    And got this back:

    DisplayName : <user>

    Licenses    : {***:ENTERPRISEPACK}

    So all good here.

    Next I tried this command:

    Get-MsolUser -All | where {$_.licenses -eq '***:ENTERPRISEPACK'}

    No results. So I tried these variants:

     Get-MsolUser -All | where {$_.licenses -eq '{***:ENTERPRISEPACK}'}

     Get-MsolUser -All | where {$_.licenses -eq {***:ENTERPRISEPACK}}

     Get-MsolUser -All | where {$_.licenses -eq "{***:ENTERPRISEPACK}"}

     Get-MsolUser -All | where {$_.licenses -eq '{***:ENTERPRISEPACK}'}

     Get-MsolUser -All | where {$_.licenses -eq "***:ENTERPRISEPACK"}

    No results. So I know I’m doing something wrong, but why won’t this work?


    Matthew Kopf

    Friday, April 19, 2019 7:54 PM

All replies