User PowerShell to get a recursive list of group members

Today I was asked to provide a list of recipients for a distribution list.  The group was full of nested groups, so may have taken a little time to work out if it wasn’t for PowerShell.  I used the Get-ADGroupMember and Get-ADUser cmdlets together to recursively get the name for each member and save the output to a text file:

Get-ADGroupMember “Managers” -Recursive | Get-ADUser -Property Name | Select Name | Out-File C:\Managers.txt

Additional properties can be specified if required.

[BlogBookmark] [Blogsvine] [del.icio.us] [Digg] [Facebook] [Furl] [Google] [LinkedIn] [MySpace] [Reddit] [Slashdot] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]