Export Groups and its members

Niazuddin Shah 0 Reputation points

How to export groups and its members information into .csv

0 comments No comments

Sign in to comment

3 answers

  1. VPHAN 36,170 Reputation points Independent Advisor

    Hi Niazuddin Shah,

    How is your issue going? Has it been resolved yet? If it has, please consider accepting the answer as it helps others sharing the same problem benefit too. Thank you :)

    VPHAN

    0 comments No comments

    Sign in to comment
  2. VPHAN 36,170 Reputation points Independent Advisor

    Hi Niazuddin Shah,

    In an on-premises environment, you will need to open an elevated PowerShell session and utilize the Active Directory module. You can retrieve the data by piping the results of the Get-ADGroup cmdlet into a loop that processes each group with the Get-ADGroupMember cmdlet. Because Get-ADGroupMember can occasionally encounter issues with groups exceeding the default 5000 member limit defined in the Active Directory Web Services configuration, it is highly recommended to select only the essential properties like the group name and the member's SamAccountName to streamline the query. You can then structure this custom object and pipe it directly into the Export-Csv cmdlet, specifying a local file path such as C:\Temp\ADGroupMembers.csv while appending the NoTypeInformation parameter to keep the resulting file clean.

    If your infrastructure relies on Microsoft Entra ID, the methodology shifts to the Microsoft Graph PowerShell module. You must authenticate first by running the Connect-MgGraph cmdlet with the GroupMember.Read.All scope to ensure sufficient directory read permissions. Once connected, retrieve your groups using Get-MgGroup and pass them into a loop using Get-MgGroupMember to query the associated members. The Graph API treats members as generic directory objects, meaning you will need to expand the AdditionalProperties attribute or extract the Id property to resolve the actual user display names accurately. After building your dataset with the group and member details, export it to a local path like C:\Temp\EntraGroupMembers.csv, making sure to include the All parameter on your initial Graph queries to force the system to paginate and capture every object in your tenant.

    Hope this answer brought you some useful information. If it did, please hit “accept answer”. Should you have any questions, feel free to leave a comment.

    VPHAN

    0 comments No comments

    Sign in to comment
  3. AI answer

    Use Microsoft Entra ID (formerly Azure AD) bulk download features to export groups and their members to CSV.

    To export all groups:

    1. Sign in to the Microsoft Entra admin center.
    2. In the left navigation, select Groups > All groups.
    3. Select Download groups.
    4. Enter a filename and select Start bulk operation.
    5. When the Success! notification appears, select its title, then select the filename to download the CSV.

    The downloaded CSV includes, for each group:

    • Object ID
    • Display name
    • Mail (if applicable)
    • Group type (Security or Microsoft 365)
    • Membership type (Assigned or Dynamic)

    To export members of a specific group:

    1. In the Microsoft Entra admin center, go to Groups.
    2. Select the group, then go to the Members tab.
    3. On the command bar, select Download members (or Bulk operations > Download members).
    4. Enter a filename and select Start bulk operation.
    5. Open the Success! notification and select the filename to download the CSV.

    The members CSV includes, for each member:

    • Object ID
    • User principal name (for user members)
    • Display name
    • Member type (User, Group, or Service Principal)

    If needed, repeat the member export for each group and combine the CSVs offline (for example, in Excel) to build a consolidated view of groups and their members.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer