1

I'm looking for a way to retrieve information about all users that belong to a particular group and store the results in CSV.
So, I use the following Azure AD command for the purpose:

Get-AzureADGroupMember -ObjectId "xxx" | get-azureaduser | Export-Csv -nti users.csv

However, the command only returns 100 users maximum.
Is there a way to return all the users that belong to a group from the CLI?

spoonboy
  • 2,570
  • 5
  • 32
  • 56

3 Answers3

5

Try Get-AzureADGroupMember -ObjectId "xxx" -all $true | ...

Look at https://learn.microsoft.com/en-us/powershell/module/azuread/get-azureadgroupmember?view=azureadps-2.0 for reference

D.J.
  • 3,644
  • 2
  • 15
  • 22
1

Using PowerShell, you can add the parameter -top xxx (-top 500 for example), or -all for all group members.

jluckyiv
  • 3,691
  • 3
  • 22
  • 15
0

You can use Get-AzADUser instead!

Dharman
  • 30,962
  • 25
  • 85
  • 135
Gill-Bates
  • 559
  • 8
  • 22
  • Welcome to StackOverflow! Can you expand your answer to include an example (with full syntax) of how to use this command? – mjk Nov 04 '20 at 17:50