Friday, 27 June 2014

Find List items having unique permissions using PowerShell / List item permissions using Powershell


PowerShell Script to Find List items having Unique Permissions and to find out to whom List items are Shared with


Clear

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

$web=Get-SPWeb -Identity "https://SP2013dev.com/sites/TestingPermissions/"

$ls=$web.Lists.TryGetList("CalcListTesting");

foreach($item in $ls.Items)
{


    if($item.HasUniqueRoleAssignments)
    {

     $i =1 ;

     Write-Host   $i "." $item.Title

    Write-Host "Groups who are associated with listitem  and their permissions are below "
   
    $item.RoleAssignments.Groups | Select Name, Roles
   
    $i=$i+1

     }
 }
 


No comments:

Post a Comment