Az ad group member list

Az ad group member list is an excellent Azure CLI command that retrieves the lists of members from an Azure AD group. In this article, I will walk you through the syntax and usage of the az ad group member list command with certain real-time examples.

Az ad group member list

Let us see the syntax of this command.

Syntax

az ad group member list --group 'The Display name of your group'
az ad group member list --group Group object ID

Example-1: Retrieving the member details using Group Display Name

We can execute the below Azure CLI command to get the lists of members available in the Azure AD group with the display name “AzureLessons New group”.

az ad group member list --group 'AzureLessons New group'

After executing the above command, I got the expected output, which is below.

PS /home/bijay> az ad group member list --group 'AzureLessons New group'                                                                                                    
[      
  {
    "@odata.type": "#microsoft.graph.user",
    "businessPhones": [],
    "displayName": "Bijay Kumar Sahoo",
    "givenName": "Bijay Kumar",
    "id": "54481342-e592-47c2-ba89-b07dcadf9346",
    "jobTitle": "Manager",
    "mail": null,
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": "Sahoo",
    "userPrincipalName": "fewlines4biju_hotmail.com#EXT#@fewlines4bijuhotmail.onmicrosoft.com"
  },
  {
    "@odata.type": "#microsoft.graph.user",
    "businessPhones": [],
    "displayName": "trp",
    "givenName": null,
    "id": "64865eec-00be-420e-b3f9-e64ec0af7e56",
    "jobTitle": null,
    "mail": "trp@tsm.com",
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": null,
    "userPrincipalName": "trp_tsm.com#EXT#@fewlines4bijuhotmail.onmicrosoft.com"
  },
  {
    "@odata.type": "#microsoft.graph.user",
    "businessPhones": [],
    "displayName": "abc",
    "givenName": null,
    "id": "2867be31-5c6b-4e5f-8d21-30a76af0ff5c",
    "jobTitle": null,
    "mail": "abc@tsm.com",
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": null,
    "userPrincipalName": "abcuser@fewlines4bijuhotmail.onmicrosoft.com"
  }
]

You can see the same output in the screenshot below as well.

Az ad group member list

Example-2: Retrieving the member details using Group Object ID

Below query will get the member details of the Azure AD Group with object ID 96b324f0-d6ed-48b1-b17f-e02835ecafb7.

ad group member list --group 96b324f0-d6ed-48b1-b17f-e02835ecafb7

After executing the above query, I got the lists of member details successfully as shown in the below screenshot.

how to get azure ad group members powershell

Conclusion

In this article, we discussed the syntax and usage of the az ad group member list Azure CLI command with real time examples how to get the member details using Group display name and object ID.

You may also like following the articles below.

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!