Powershell: Get-AzureADGroupMember doesnt give me the whole list
17,638
Yes, you need the -All
parameter. Otherwise there is a limitation on the number of members the Get-AzureADGroupMember will return.
For anyone else running into this issue, the command is like this:
(Get-AzureADGroup -Filter "DisplayName eq 'GroupName'" -All $true | Get-AzureADGroupMember -All $true).Count
Alternatively, to store the output in variables for later use:
$AzureADGroup = Get-AzureADGroup -Filter "DisplayName eq 'GroupName'" -All $true
$AzureADUsers = $AzureADGroup | Get-AzureADGroupMember -All $true
$AzureADGroupCount = $AzureADUsers | Measure-Object
See for reference: https://techcommunity.microsoft.com/t5/Azure-Active-Directory/Azure-AD-Dynamic-Groups-Display-Membership-and-count-members/td-p/69657
Related videos on Youtube
Author by
Robin
Updated on June 04, 2022Comments
-
Robin almost 2 years
I want to sync two AzureAD Groups, so I read out both groups with
Get-AzureADGroupMember
.The Problem is, I only get 103 People out of the group instead of 615...
What Can I do, to get the whole list out of the groups?
Thanks in advance, Robin
-
Robin over 5 yearsI got it, just put -All $True after the Get-AzureADGroupMember
-