SOLVED

Get all license groups

%3CLINGO-SUB%20id%3D%22lingo-sub-1497093%22%20slang%3D%22en-US%22%3EGet%20all%20license%20groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1497093%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20looking%20for%20a%20way%20to%20get%20all%20AzureAD%20groups%20that%20assign%20licenses%20using%20the%20AzureAD%20Powershell%20module.%20%22Get-AzureADGroup%22%20lacks%20the%20licensing%20detail.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20that%20%22%3CSPAN%20class%3D%22hljs-pscommand%22%3EGet-MsolGroup%3C%2FSPAN%3E%3CSPAN%20class%3D%22hljs-parameter%22%3E%20-All%3C%2FSPAN%3E%3CSPAN%3E%20%7C%20Where%20%7B%3C%2FSPAN%3E%3CSPAN%20class%3D%22hljs-variable%22%3E%24_%3C%2FSPAN%3E%3CSPAN%3E.Licenses%7D%3C%2FSPAN%3E%22%2C%20but%20we%20don't%20want%20to%20leverage%20the%20MsolService.%20module%20unless%20we%20absolutely%20have%20to.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1497093%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELicense%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1497674%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20all%20license%20groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1497674%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20either%20that%2C%20or%20querying%20the%20Graph%20API%20directly.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1498894%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20all%20license%20groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1498894%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B-%20Thanks%20for%20the%20reply.%20That's%20what%20I%20was%20afraid%20of.%20We%20want%20to%20authenticate%20with%20a%20service%20principal%2C%20which%20the%20MSOL%20module%20doesn't%20seem%20to%20support.%20I%20will%20pursue%20a%20graph%20query.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional 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

2 Replies
Highlighted
Solution

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

Highlighted

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