Compare two azure ad groups RRS feed

  • Question

  • How is it possible to compare 2 azure ad groups. The one group is containing 3640 and the other 3661 users - so I would like to find the difference

    I can find a lot of examples of powershell for comparing ad groups - but not with azure ad groups

    Thursday, August 30, 2018 8:22 AM

All replies

  • help Get-AzureRmADGroupMember -full

    It's the same as AD.


    Thursday, August 30, 2018 8:28 AM
  • Hi,

    Thanks for your question.

    I agree with jrv sir.

    If you want to compare 2 azure ad groups member's specific property, you can use the command below.

    diff (Get-AzureRmADGroupMember "Group 1") (Get-AzureRmADGroupMember "Group 2") -Property 'propertyname' -IncludeEqual

    Best Regards,



    Just do it.

    Thursday, August 30, 2018 9:10 AM
  • A slightly different example using the AzureAD module instead of Azure Resource Manager.

    $membersOfGroup1 = Get-AzureADGroup -SearchString "GroupName1" | 
        Get-AzureADGroupMember | 
        Select-Object -ExpandProperty DisplayName
    $membersOfGroup2 = Get-AzureADGroup -SearchString "GroupName2" | 
        Get-AzureADGroupMember | 
        Select-Object -ExpandProperty DisplayName
    Compare-Object -ReferenceObject $membersOfGroup1 -DifferenceObject $membersOfGroup2

    Thursday, August 30, 2018 10:10 AM