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

Share:
17,638

Related videos on Youtube

Robin
Author by

Robin

Updated on June 04, 2022

Comments

  • Robin
    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
      Robin over 5 years
      I got it, just put -All $True after the Get-AzureADGroupMember