Library and docs permissions using Powershell

…this post was published on 2015 January 2.

The Question is: How to get list’s and doc’s permissions in SharePoint 2010 using Powershell?
The Answer

For library:

$myweb =  Get-SPWeb “Site_collection URL” 
$mylist = $myweb.Lists | Where-Object { $_.Title -eq ‘docs’ }
$mylist.RoleAssignments

 

For each doc in that library

foreach ($item in $mylist.Items )
{
     “Document Name is: “+$item.Name
     ” and the persmissions are: “
     $item.RoleAssignements
     “————————–“
}

This entry was posted in Powershell, Sharepoint 2010. Bookmark the permalink.