2

I have a few users that have non-standard permissions for OneDrive for Business . I've found a PowerShell Script that will list all OneDrives but not the permissions.

Is there a way given a site, to list the permission using PowerShell?

1 Answer 1

0

Okay its a little hard since there are so many it depends. Like on lists with unique permissions within the site and so on. however this code will get you the core of what you asked for. Try it out and let me know if it works for you.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$web = get-spweb "https://yourweb"

$roleAssignments = $web.RoleAssignments

foreach ($oRoleAssignment in $roleAssignments)
{
    write-host $oRoleAssignment.member
    foreach ( $binding in $oRoleAssignment.RoleDefinitionBindings )
    {
        write-host $binding.name
    }
}

You can get very deep with permissions and powershell, if you want to know more look at the RoleDefinitionBindings Class on MSDN.

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.