2

I am looking for a PowerShell command to get the permissions of a SharePoint group on a securable object.
I have googled for a while but without success.

I am aware of the GetUserEffectivePermissionInfo method offered by the SPSecurableObject.
But this method only gives permissions of a user.

Any help will be greatly appreciated

1 Answer 1

2

I don't have one that takes a specific object as input, but this may help. It will list out the role assignments on web, list, items for users and SharePoint groups.

Start-SPAssignment -global    
$sites = Get-SPsite -limit All

    foreach ($site in $sites)
    {
        foreach ($web in $site.allwebs)
        {
            Write-Host -BackgroundColor green -ForegroundColor white $web.url
            $web.RoleAssignments

            foreach ($list in $web.lists)
            {
               If ($list.HasUniqueRoleAssignments)
               {
                    Write-Host -BackgroundColor yellow -ForegroundColor black $list.Title
                    $list.RoleAssignments

                    foreach ($item in $list.Items)
                    {
                        If ($item.HasUniqueRoleAssignments)
                        {
                            Write-Host -BackgroundColor red -ForegroundColor yellow $item.UniqueId
                            $item.RoleAssignments
                        }
                    }
               }
            }
        }
    }
Stop-SPAssignment -global

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.