Get all users from a specific SPGroup

This PowerShell code write all users from a specific SharePoint Group to a CSV-File.

Get-SPSite http://urlofsitecollection |
Select -ExpandProperty RootWeb |
Select -ExpandProperty Groups |
Where {$_.Name -EQ “Specific Name of the Group“} |
Select -ExpandProperty Users |
Select Name, Email | Export-csv -path D:\myPath\Groupmembers.csv

Leave a Reply

Your email address will not be published. Required fields are marked *