Export SharePoint group members using SharePoint 2010 PowerShell
The script for exporting groups membership is following:
$site = Get-SPSite "http://mysites"This script will save groups and user from entire site collection to specified file.
$filename = "c:\users.txt"
foreach($group in $site.RootWeb.SiteGroups)
{
"Group:" + $group.Name | Out-File $filename -Append
foreach ($user in $group.Users)
{
" User:" + $user.UserLogin | Out-File $filename -Append
}
}
Post a Comment