#SharePoint 2013 #PowerShell: How to get user permissions report

function Get-SPPermissionsReport($web, $recursive)
{
  $web | Get-SPUser | % { New-Object PSObject -Property @{
    UserLogin = $_.UserLogin
    'Roles given explicitly' = $_.Roles
    'Roles given via groups' = $_.Groups | %{$_.Roles}
    Groups = $_.Groups
    Url = $web.Url
    }
  }
  if($recursive) { $web.Webs | % { Get-SPPermissionsReport $_ $recursive } }
}
$web = Get-SPWeb http://yoursharepoint/sites/department
Get-SPPermissionsReport $web $true | Sort-Object UserLogin | Out-GridView

Then you can apply an additional filter by user or url right in the GridView.
You can add an additional matching criteria in the GridView: e.g. match by Role/Group name

#SharePoint 2010 #PowerShell: How to get user permissions report

How to check who has access to a particular site in SharePoint

$urlWeb = "http://mycompany/sites/mydepartment"

Get-SPUser -Web $urlWeb | select UserLogin, @{name="Exlicit given roles";expression={$_.Roles}}, @{name="Roles given via groups";expression={$_.Groups | %{$_.Roles}}},Groups | format-Table -auto

You will get somthing like this output:

NEW VERSION: https://vlasenko.org/2014/05/07/sharepoint-2013-powershell-how-to-get-user-permissions-report/