# determining group membership from a bulk list of groups.

**URL:** <https://forums.powershell.org/t/determining-group-membership-from-a-bulk-list-of-groups/429>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/determining-group-membership-from-a-bulk-list-of-groups/429 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/determining-group-membership-from-a-bulk-list-of-groups/429/1 "2011-12-31T18:30:00Z")

</div>

by IrritatedLlama at 2012-12-20 09:17:43

> Greetings [Powershell.org](http://Powershell.org) Community! Glad I found you. I will be lurking around and posting where I can. Right now, I have something of an urgent issue…  
>   
> I am trying to get the groove of Powershell, I am still a noob with it though. I am having an issue with this little commandlet I wrote and I was hoping you point me in the right direction…   
>   
> `get-content -path c:\Output\ProdSwanFQDN.txt| % {Get-QADGroupMember} | select SamAccountName,displayname,first,last,email| ft -AutoSize > c]Which gives me the prompt:cmdlet Get-QADGroupMember at command pipeline position 1Supply values for the following parameters:Identity:Of course, I don’t know what it wants. I have a list of the SamAccountNames for the groups and a path to them in a csv at the specified location… It is formatted like this:MyDoman.net/path/path/Accounts/SecurityGroups/GroupNameI am using the Quest version of powershell… Don’t know if that makes a difference to this community. I will be feverishly monitoring this thread, so let me know if you need more info. I will also post the solution in the unlikely event that I figure it out…Thanks in advance!`

by IrritatedLlama at 2012-12-20 10:10:17

> Here… It’s dangerous to go alone… Take this…  
>   
> `$csv = Get-Content "c:\Output\GroupMembership.txt"$result = $csv | foreach-object {$group=$get-qadgroupmember "$" -sizelimit 0 -indirect | select-object samaccountname,@{n="GroupName";e={$group}}}$result | export-csv c:\Output\GRP-Result.txt`  
>   
> This ran like a charm. The output is a bit muddy, but I will deal with that. As I always like to credit brilliance to its origin… I found it here: [http://stackoverflow.com/questions/9282 … ort-to-csv](http://stackoverflow.com/questions/9282324/powershell-list-groups-and-members-from-ad-and-export-to-csv)

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:57pm UTC](https://forums.powershell.org/t/determining-group-membership-from-a-bulk-list-of-groups/429/2 "2024-05-16T20:57:55Z")

</div>


