문제

There are many document libraries in in sites instead of going each document library how can I write PowerShell to Break Permission Inheritance for all document libraries in a Site ,

도움이 되었습니까?

해결책

This works for me (tested in SP 2013):

CLS
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
 
$libraryName="TestLibrary"

$site=Get-SPSite "http://webSPapplication.com/sites/helloSite"

$library=$site.RootWeb.Lists | where {$_.Title -eq $libraryName  }

$library.HasUniqueRoleAssignments

#keep all existing permissions and Item level permissions

$library.BreakRoleInheritance($True,$True)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top