This below powershell scriptwill export all the sitecollection groups to a specified text file.
$site = Get-SPSite"http://www.shopsharepoint.com"
$filename = "d:\shopsharepointusergroups.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
}
}