Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Do you want to learn various ways to list AD group members with PowerShell? This guide teaches you 3 methods to accomplish this.

Option 1: Use the Get-ADGroupMember Command

The fastest and easiest method to list AD group members is to run the Get-ADGroupMember command.

The Get-ADGroupMember cmdlet has a parameter called Identity. This is the parameter you use to specify the AD group you want to list its members.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Furthermore, you can specify the group’s sAMAccountName or distinguishedName in the Identity parameter. The commands below list the members of the AD group, Remote Writers.

#1 Best Overall
Sale
DbillionDa Cat 8 Ethernet Cable, 6FT 40Gbps 2000MHz RJ45 LAN Cable | 3FT 6FT 10FT 15FT 20FT 25FT 30FT 35FT 40FT 50FT 60FT 65FT 100FT 150FT Internet Cable for Router, Modem, Switch, PS5, Xbox
  • Designed for Outdoor & Direct Burial Installations – Heavy-duty double-shielded Cat8 Ethernet cable minimizes EMI/RFI interference and delivers stable long-distance performance. Waterproof, anti-corrosion PVC jacket allows safe direct burial and reliable use in outdoor or indoor environments.
  • 26AWG for Stable High-Load Networks – Thicker 26AWG conductors provide faster, more stable data transmission than standard 32AWG cables. Ideal for high-performance home networks, gaming setups, smart homes, and data-intensive applications.
  • F/FTP Shielding & Hyper-Speed Performance: Cat8 Ethernet cable constructed with 4 shielded foiled twisted pairs and 26AWG OFC conductors; supports bandwidth up to 2000 MHz and data transmission speeds up to 40 Gbps, effectively reducing signal interference and ensuring stable connections. Ideal for low-latency gaming, 4K/8K streaming, and high-speed internet connections.
  • RJ45 Connectors & Wide Compatibility: Cat8 Ethernet cable with two shielded RJ45 connectors; compatible with networking switches, IP cameras, routers, Nintendo Switch, modems, PS3, PS4, Xbox, patch panels, servers, smart TVs, and more; works with Cat7, Cat6, Cat5e, and Cat5 devices
  • Weatherproof & UV Resistant: Outdoor-rated Cat8 Ethernet cable with UV-resistant PVC jacket; withstands direct sunlight, extreme cold, humidity, and hot weather; anti-aging and durable; Includes 18-month support.
The first command uses the sAMAccountName (“Remote Writers”) of the group. However, the second command uses the group’s distinguishedName (“CN=Remote Writers,DC=itechguides,DC=local”). Remember to change these before you run your command.
Get-ADGroupMember -Identity "Remote Writers"
Get-ADGroupMember -Identity "CN=Remote Writers,DC=itechguides,DC=local"

The two commands produces the same result. As shown in my screenshot below, the AD group has two group members – Victor Ashiedu and Anthony Raj.

If you look closer to the result of the last command, each user listed has three properties – name, SamAccountName, and distinguishedName – that you may want in your report.

To display these three properties and discard the rest, pipe the commands above to a Select-Object cmdlet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
I am showing only the first command. If you prefer the command that uses distinguishedNam as the identity of the group, feel free to use the second command.
Get-ADGroupMember -Identity "Remote Writers" | Select-Object name, SamAccountName, distinguishedName

Isn’t this better looking? It sure does, but you can even modify the headers to look even better.

Use The PowerShell Get-ADGroupMember Command To List AD Group Members

To use custom headers for the result, modify the command as shown below.

Get-ADGroupMember -Identity "Remote Writers" |  Select-Object @{Name = "Name";Expression = {$_.name}}, @{Name = "User Name";Expression = {$_.SamAccountName}}, @{Name = "distinguishedName";Expression = {$_.distinguishedName}}

The last command produces a better-looking header.

Option 2: Use the Get-ADGroup Command

In the last section, you learned how to list AD group members with the Get-ADGroupMember command. PowerShell has another cmdlet – Get-ADGroup – that you can use to display the properties of an AD group.

As you would expect, one of the properties of an AD group is group members. To list the members of an AD group with the Get-ADGroup, run the command and specify the Properties parameter as members.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
UGREEN Cat 8 Ethernet Cable 6FT, High Speed Braided 40Gbps 2000Mhz Network Cord Cat8 RJ45 Shielded Indoor Heavy Duty LAN Cables Compatible with Gaming PC PS5 PS4 PS3 Xbox Modem Router 6FT
  • 40 Gbps 2000 Mhz High Speed: The Cat 8 ethernet cable support max. 40 Gbps data transfer and 2000 MHz Brandwith, ideal for gaming and streaming, greatly improving upload and download speed, sound, image and resolution quality
  • Excellent Anti-interference: The ethernet cable comes with 4 shielded foiled twisted pairs (F/FTP), pure copper core and gold-plated RJ45 connector, reducing interference, noise and crosstalk, making network speed faster and more stable
  • Marvelous Durability: Internet cable wrapped with quality cotton braided cord, which makes the LAN cable stronger and more durable. The test proves that this internet cable can be bent at least 10000 times without broken, very suitable for long-term use
  • PoE Supported: All lengths of ethernet cord can support the PoE power supply function except 65ft. You don't need additional power supply when installing a PoE camera, which is very convenient and safe
  • Wide Compatibility: With the RJ45 Connector, network cable can be perfectly compatible with computers, laptops, modems, routers, PS5, X-Box and other networking devices. It can also be fully backward compatible with Cat7, Cat6e, Cat6, Cat5e, Cat5

Here is a sample command that lists the members of the “Remote Writers” AD group with the Get-ADGroup PowerShell command.

Get-ADGroup -Identity "Remote Writers" -Properties members

As expected, the command lists the properties of the AD group member, including the group members. I have highlighted the members in the screenshot below.

To display the names of the group members only and discard other properties of the AD group, modify the command as shown below…

Get-ADGroup -Identity "Remote Writers" -Properties members | Select-Object -ExpandProperty Members

The command now lists the names of the distinguishedNames of users in the AD group. This is great, but we can make it even better by displaying the actual names of the group members.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Use The PowerShell Get-ADGroup Command To List AD Group Members

To extract the names of the group members (the CN of the DN value) from the result of the last command, add the Split operator (-Split) to the last command. Then, pipe the result of the command to ConvertFrom-StringData.

Finally, return the CN property from the command. Here is what the final command looks like.

((Get-ADGroup -Identity "Remote Writers" -Properties members | Select-Object -ExpandProperty Members) -split "," | ConvertFrom-StringData).CN

And here is the result in PowerShell…

Use The PowerShell Get-ADGroup Command To List AD Group Members

Option 3: Combine the Get-ADGroup and Get-ADGroupMember Commands

In the first two examples, I discussed how to use Get-ADGroup or Get-ADGroupMember PowerShell commands to list AD group members. This is great, but there may be coding scenarios where you need to find the name of the group, then list its members.

Rank #3
Vabogu Cat 8 Ethernet Cable 6FT, 40Gbps 2000MHz High Speed Network cable | 1.5FT 3FT 10FT 15FT 20FT 30FT 40FT 50FT 60FT 100FT Heavy Duty 26AWG Shielded Gold-Plated RJ45 LAN Cable, for Gaming PC Router
  • 🔌【Ultra Internet speed】Cat 8 ethernet cable support bandwidth up to 2000MHz and boosts the speed of data transmission up to 40Gbps,26AWG Cables suitable Indoor/Outdoor at hyper speed without worrying about cable mess, Cat8 can reduce any signal interference to the full extent. Allow you to stream HD videos, music, surf the net, play games at Hyper Speed.
  • 🔌【RJ45 Connectors & Wide Compatibility】With two shielded RJ45 connectors at both ends, the Cat8 Ethernet cable works perfectly Compatible with all the previous(cat5, cat5e, cat6, cat6a and cat7), And with IP Cam, routers, Nintendo switch, ADSL, Adapters, Modem, PS3, PS4, X-box, Patch panel, Servers, Networking Printers, Netgear, NAS, VoIP phones, laptop, Coupler, Hubs, Keystone jack, Smart TV, Imac and other device with RJ45 connectors.
  • 🔌【Durable &🔌【Customer Care 24-7】You can contact us: we're here for you and we will reply as soon as possible. We believe in our clients' satisfaction and we always do our best to help. shield, Woven mesh shield, Shielded with high quality UV-resistant PVC jacket, the outdoor rated Cat8 Ethernet cable is anti-aging, It can withstand direct sunlight and extreme cold & humid & hot weather yet still working efficiently. Can be buried directly . Suitable for both outdoor and indoor use.
  • 🔌【26AWG & Superior Performance】Comparing with other 32AWG Ethernet cable, 26AWG Cat8 is thicker, a lot faster and stable in data transferring, which is perfectly suitable for AI smart products, like Amazon Alexa, Apple Siri, Google Home, It is suitable for small or middle enterprise LANs, especially for data center switch-to-server interconnections.With sturdy high speed network cable, you will not experience a lag or stop on transferring data.
  • 🔌【Customer Care 24-7】You can contact us: we're here for you and we will reply as soon as possible. We believe in our clients' satisfaction and we always do our best to help.

Even in some more complex situations, you may need to list the members of all ad groups in an AD GroupScope. For example, you may be required to list all users that belong to the DomainLocal group.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In the following sub-sections, you will learn how to list AD group members in the scenarios described above.

Example 1: Get the AD Group Name with Get-ADGroup and List its Members with Get-ADGroupMember

If you want to list the members of an AD group but do not know the full name of the group, you can use the Get-ADGroup PowerShell command to find the name of the group.

Then, pipe the result to the Get-ADGroupMember. Finally, to select the properties of the group members you want to return, pipe the Get-ADGroupMember command to the Select-Object command.

Here is a sample command. In this command, I want to list the members of the AD group that contains Remote in its name.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
If more than one group contains the name you have in the -Filter parameter of the Get-ADGroup command, the whole command will return an error. If you believe that your AD forest may have a group with multiple results for this command, pipe the Get-ADGroup into ForEach-Object as shown in the second command below.
Get-ADGroup -Filter {name -like "*Remote*"} | Get-ADGroupMember | Select-Object name, objectClass,SamAccountName,distinguishedName
Get-ADGroup -Filter {name -like "*Remote*"} | ForEach-Object { Get-ADGroupMember -identity $_.SamAccountName | Select-Object name, objectClass,SamAccountName,distinguishedName}

The last command works whether the Get-ADGroup portion of the command returns one or multiple results. Here is what the result looks like in PowerShell…

Example 2: Get AD GroupScope with Get-ADGroup and List its Members with Get-ADGroupMember

As I mentioned in the introduction of this section, you can also list the members of all groups in a group scope.

Rank #4
Sale
Jadaol Cat6/Cat6A Ethernet Cable 50FT Flat with Clips 10Gbps Network, White | 1FT 3FT 5FT 10FT 15FT 20FT 25FT 30FT 35FT 50FT 60FT 75FT 100FT 150FT 200FT LAN Patch Cable for Router, Modem, Switch, Gaming
  • Cat 6 performance at a Cat5e price but with higher bandwidth
  • High Performance Cat6, 30 AWG, RJ45 Ethernet Patch Cable provides universal connectivity for LAN network components such as PCs,computer servers,printers,routers,switch boxes,network media players,NAS,VoIP phones
  • Jadaol cat6 standard cable support Cat8 and Cat7 network and provides performance of up to 250 MHz 10Gbps and is suitable for 10BASE-T, 100BASE-TX (Fast Ethernet), 1000BASE-T/1000BASE-TX (Gigabit Ethernet) and 10GBASE-T (10-Gigabit Ethernet)
  • UTP(Unshielded Twisted Pair) patch cable with RJ45 gold-plated Connectors and are made of 100% bare copper wire, ensure minimal noise and interference
  • The unique flat cable shape allows for a cleaner and safer installation. You can easily and seamlessly make the cable run along walls, follow edges & corners or even make it completely invisible by sliding it under a carpet.

To do this, first list the groups in the AD group scope with the Get-ADGroup. Then, to list the group members in the groups in the scope, pipe the result to the Get-ADGroupMember PowerShell command.

Here is a sample command that lists all group members in the DomainLocal GroupScope.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Get-ADGroup -Filter {GroupScope -eq "DomainLocal"} | Get-ADGroupMember | Select-Object name, objectClass,SamAccountName,distinguishedName
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Applications: Export AD Group Members to CSV or Text File

In the first three sections of this guide, I discussed how to display members of an AD group on the PowerShell console. But what if you need to send the result of your command as a text or CSV file?

I am glad to announce that it is as easy as pie. To export members of an AD group to a text file, pipe the result of any of the commands in the previous sections to the Out-File command.

How to Export AD Group Members to a Text File with PowerShell

Here is a modified version of the last command in the previous section. This command exports the members of the DomainLocal GroupScope to a text file.

I boldened the Out-File portion of the command to make it easy to spot.
Get-ADGroup -Filter {GroupScope -eq "DomainLocal"} | Get-ADGroupMember | Select-Object name, objectClass,SamAccountName,distinguishedName | Out-File C:\ADGroupMembership\DomainLocal.txt

The upper part of the screenshot below shows the above command in PowerShell. Meanwhile, the lower part of the command shows the result in a text file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to Export AD Group Members to a CSV File with PowerShell

Similar to the command in the last sub-section, I have piped the last command in the previous section to the Export-CSV command. See my sample command below…

Best Value
Cat 8 Ethernet Cable 50 ft, 40Gbps 2000MHz Shielded RJ45 Network LAN Cable | 6Ft 10Ft 15Ft 20Ft 25Ft 30Ft 35Ft 40Ft 60Ft 75Ft 100Ft 150Ft 200Ft High Speed Heavy Duty Internet Cable for Modem Router
  • Gigbit Ethernet Cable:Powerful ethernet cable Cat 8 support bandwidth up to 2000MHZ and 40Gbps data transmitting speed,faster than Cat7,Cat6,Cat6a,Cat6e,Cat5,Cat5e.So you can connect to LAN/WAN segments and network devices at maximum speed to surf the web, download videos & music, connect to cloud data servers and other smart home and office products that require high speed and high performance networking, making it the fastest network cable standard available today.
  • Superior Performance & 26AWG:Cat8 Ethernet cable is made of 4 shielded foiled twisted pair(F/FTP) And 26AWG single-strand OFC wire,Each twisted pair is individually shielded with aluminum foil.It provides better protection from crosstalk,noise,and interference that can degrade the signal quality.Comparing with other 32AWG Ethernet cable,26AWG Cat8 is thicker,a lot faster and stable in data transferring,which is perfectly suitable for AI smart products.
  • Widely Used & RJ45 Connectors:Cat 8 Ethernet Cable with two shielded gold plated RJ45 connectors at both ends,Perfect for networking switch,routers,ADSL,network adapters,hubs,modems,PS3,PS4,PS5,NAS,IP Cam,Mac,Laptop,coupler,x-box 360 gaming stations,printers,patch panels,Keystone jack,smart TV and other device with RJ45 connectors.It is suitable for small or middle enterprise LANs, especially for data center switch-to-server interconnections.
  • Weatherproof & UV Resistant:Cat8 cable is waterproof, anti-corrosion, more durable and flexible,the outer layer is shielded by high-quality UV-resistant PVC sheath. it can withstand direct sunlight and extreme cold, humid and hot weather, suitable for outdoor/indoor and heavy duty work.
  • Our customer service:Premium design with great quality. Each of our cat8 cables is supplied with free cable clips for you to secure the wires.18 months warranty with lifetime welcoming customer service.
Get-ADGroup -Filter {GroupScope -eq "DomainLocal"} | Get-ADGroupMember | Select-Object name, objectClass,SamAccountName,distinguishedName | Export-CSV C:\ADGroupMembership\DomainLocal.csv -NoTypeInformation

Frequently Asked Questions

1. How do I list members of an AD group in PowerShell?

The quickest way to list members of AD group in PowerShell is to run the Get-ADGroupMember command. For example, the command below lists the members of the “Remote Writers” AD group.

Get-ADGroupMember -Identity “Remote Writers”

2. How can I see the members of an AD group in CMD?

To see the members of an AD group in CMD, run the net group command. The same command below lists the members of the “Remote Writers” AD group.

net group /domain “Remote Writers”

3. How do I export a list of members of an AD group?

To export the members of an AD group to a text file, pipe the output of the Get-ADGroupMember command to the Out-File command.

For detailed steps, read this section of the guide – How To Export AD Group Members To A Text File With PowerShell.

However, if you chose to export AD group members to a CSV file, pipe Get-ADGroupMember command to the Export-csv command.

To read the full steps, navigate to How To Export AD Group Members To A CSV File With PowerShell section of this guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
4. How do I get local group membership in PowerShell?

To get local group membership in PowerShell, run the Get-LocalGroup command.

5. How do I run qsquery?

To learn how to run Dsquery, run the command below:

Dsquery /?

The command lists all Dsquery command options. Here is the full list of the command options:
dsquery computer – finds computers in the directory.
dsquery contact – finds contacts in the directory.
dsquery subnet – finds subnets in the directory.
dsquery group – finds groups in the directory.
dsquery ou – finds organizational units in the directory.
dsquery site – finds sites in the directory.
dsquery server – finds AD DCs/LDS instances in the directory.
dsquery user – finds users in the directory.
dsquery quota – finds quota specifications in the directory.
dsquery partition – finds partitions in the directory.
dsquery * – finds any object in the directory by using a generic LDAP query.

Conclusion

Windows SysAdmins receive all kinds of requests, including sending all members of an AD group. If you know how to perform this task with PowerShell, it makes your life much easier.

Well, now that you’ve gone through this guide, I hope you’ve been able to send that report to your manager with some spring in your steps!

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If this guide absolutely made your day, Feel free to share your thoughts by utilizing the “Leave a Reply” form located at the bottom of this page.

Alternatively, you can respond to the “Was this page helpful?” question below.

Finally, to even learn more ways to impress your boss with PowerShell, visit our Windows PowerShell How-To Guides or Windows PowerShell Explained pages.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.