Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$web = Get-SPWeb http://site-name/Inst/site
$list = $web.Lists.TryGetList("Deleted Documents")
if($list.HasUniqueRoleAssignments -eq $False)
{
$list.BreakRoleInheritance($True)
}
[Microsoft.SharePoint.SPRoleAssignmentCollection] $spRoleAssignments=$list.RoleAssignments
for([int] $a=$spRoleAssignments.Count-1; $a -ge 0;$a--)
{
$spRoleAssignments.Remove($a);
}
$web.Dispose()
$web = Get-SPWeb http://site-name/Inst/site
$list = $web.Lists.TryGetList("Deleted Documents")
if($list.HasUniqueRoleAssignments -eq $False)
{
$list.BreakRoleInheritance($True)
}
[Microsoft.SharePoint.SPRoleAssignmentCollection] $spRoleAssignments=$list.RoleAssignments
for([int] $a=$spRoleAssignments.Count-1; $a -ge 0;$a--)
{
$spRoleAssignments.Remove($a);
}
$web.Dispose()
No comments:
Post a Comment