May 12 2017
- last edited on
Jan 14 2022
Created Azure AD Dynamic Groups. These Groups have thousands of members. The Azure Portal GUI will show the group as having "1000+ Members". Drilling into this Dynamic group will display the following message: "Group members cannot be shown for this group. This group has more than 1000 members".
get-azureadgroup -SearchString "GroupName" | Get-AzureADGroupMember
The results show 100 members.
Getting a count also shows 100 members.
(get-azureadgroup -SearchString "GroupName" | Get-AzureADGroupMember).COUNT
Appears to be a limit on the results returned. How can I display all the members in a Dynamic Group and get a proper count?
May 13 2017 11:49 AMSolution
Try the -All parameter?
May 15 2017 10:04 AM
May 15 2017 12:09 PM
It's a boolean parameter, 1 equals $true :) And don't get me started on the stupid syntax used by the AzureAD module, gotta love programmers...
Mar 19 2019 10:23 AM
I would just browse to the AAD group in Azure portal and get the Object ID from the Overview blade.
Then run the below:
(Get-AzureADGroupMember -All $true -ObjectId "GUID OF AAD GROUP" | select mail).Count
Nov 15 2019 04:04 PM
Apr 01 2020 09:42 PM
What about the -All parameter in case of Office 365 groups
|LDAP display name||Available on cmdlets||Value||Comments|
|n/a||Get-UnifiedGroup||Integer||For example, Get-UnifiedGroup -Filter "GroupExternalMemberCount -gt 0".|
Filterable properties for the Filter parameter
-All parameter - when used the command does not generate any output,
but it works without but then not sure if it was able to check/traverse/enumerate all groups or not ,
As in just the first 100 or something when -All or unlimited is not specified
Jul 12 2021 08:11 PM
@Himanshu Singh hi!!!
less complex (Get-AzureADGroupMember -all 1 -ObjectId "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").count