0

I have been tasked with finding our site's SharePoint groups that have the Group Setting "Who can view the membership of the group?" set to Group Members. Is there a search feature or PowerShell command that can provide this?

2 Answers 2

0

Try below snippet

$site = Get-SPSite("http://siteurl");

foreach($subweb in $site.AllWebs){
    foreach($group in $subweb.Groups)
    {           
        if($group.OnlyAllowMembersViewMembership -eq $true)
            write-host $group.Name
    }
    $subweb.Dispose();
}

$site.Dispose();
0

Small update - cool script but it needs the statement block operators before and after the write-host command in the if statement:

$site = Get-SPSite("http://siteurl");

foreach($subweb in $site.AllWebs){
    foreach($group in $subweb.Groups)
    {           
        if($group.OnlyAllowMembersViewMembership -eq $true)
            {
             write-host $group.Name
            }
    }
    $subweb.Dispose();
}

$site.Dispose();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.