Forum Discussion
Jeff_Lamb
Jun 29, 2020Brass Contributor
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
It's either that, or querying the Graph API directly.
- Bas_de_JongCopper 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.
It's either that, or querying the Graph API directly.
- Jeff_LambBrass 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.