Forum Discussion

Jeff_Lamb's avatar
Jeff_Lamb
Brass Contributor
Jun 29, 2020

Get all license groups

I am looking for a way to get all AzureAD groups that assign licenses using the AzureAD Powershell module. "Get-AzureADGroup" lacks the licensing detail. 

 

I know that "Get-MsolGroup -All | Where {$_.Licenses}", but we don't want to leverage the MsolService. module unless we absolutely have to. 

 

Thank you

  • Bas_de_Jong's avatar
    Bas_de_Jong
    Copper Contributor

    In case anyone is still searching for an answer to this in 2023:

    get-mggroup -Property AssignedLicenses | Where-Object {$_.AssignedLicenses}

    ...should do the trick.

    • Jeff_Lamb's avatar
      Jeff_Lamb
      Brass Contributor

      VasilMichev - Thanks for the reply. That's what I was afraid of. We want to authenticate with a service principal, which the MSOL module doesn't seem to support. I will pursue a graph query. 

Resources