I have written a script that created a document library called "Audit Logs" for every site collection in our environment. I then wanted to ensure that only Site Collection administrators and the individual site Owners group had access to this document library. I was able to write a script to break the inheritance, allowing only the site collection administrators to view the library.
I was told after the fact that I also needed to make sure the the Owners group was able to access the Audit logs as well.
Here is what I have so far:
$site = Get-SPSite | Get-SPWeb -limit all | ForEach-Object {
$listName = "Audit Logs"
$list = $_.Lists[$listName]
$list.BreakRoleInheritance($False)
$list.Update()
}
How do I add the Owners group to the ACL for each of the Audit Log folders? I have seen various methods for adding individual user accounts, but not for a group.
I am using powershell and Sharepoint 2010 Enterprise.
Thanks in advance!