Quantcast
Channel: shopSharepoint.com: Blog
Viewing all articles
Browse latest Browse all 80

Powershell Script to export sitecollection groups from a specific sitecollection

$
0
0

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
    }
}


Viewing all articles
Browse latest Browse all 80

Trending Articles