Get all license groups

Brass Contributor

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

3 Replies
best response confirmed by Jeff Lamb (Brass Contributor)

It's either that, or querying the Graph API directly.

@Vasil Michev - 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. 

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

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

...should do the trick.