Vlad K
Vlad K

Reputation: 2831

Get all users for the Azure AD group in Azure CLI - 100 limit issue

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?

Upvotes: 2

Views: 15998

Answers (3)

user16363304
user16363304

Reputation: 11

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

Upvotes: 1

Gill-Bates
Gill-Bates

Reputation: 679

You can use Get-AzADUser instead!

Upvotes: -1

D.J.
D.J.

Reputation: 4034

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

Upvotes: 6

Related Questions