how to export a list of group members

JenniferHolmes-7524 0 Reputation points
2026-02-25T19:50:25.82+00:00

I need a complete list of members of a group in Active Directory, How do I export that?

Microsoft Security | Active Directory Federation Services
0 comments No comments

1 answer

Sort by: Newest
  1. AI answer

    2026-02-25T19:51:00.8066667+00:00

    To export a list of group members in Active Directory, you can use the Get-ADGroupMember cmdlet in PowerShell. Here’s how you can do it:

    1. Open PowerShell with administrative privileges.
    2. Use the following command to get the members of a specific group:
         Get-ADGroupMember -Identity "<GroupName>" | Select-Object Name, SamAccountName, UserPrincipalName | Export-Csv -Path "C:\path\to\your\file.csv" -NoTypeInformation
      
      Replace <GroupName> with the name of your group and specify the path where you want to save the CSV file.
    3. This command retrieves the members of the specified group and exports their names, SamAccountNames, and UserPrincipalNames to a CSV file.

    Make sure you have the necessary permissions to run this cmdlet and access the group information.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.