Total Powershell newbie here, but I have managed to write a couple scripts so far that have been working.
We are using 2010 Enterprise edition, and I have been tasked with creating a script that will add a new Document Library to every site collection....No problem, got that one created. But the kicker on this was that they want the document library to be hidden from all users except for Site Collection Administrators.
I have searched for 2 days straight (Google isnt returning any blue links anymore, just purple haha) and have not been able to find the answer.
Could anybody help me out with this? What do I add to this script to make the new Libraries hidden from everyone except site collection admins?
this is what I have to create the libraries:
$sites = get-spsite -webapplication http://portal -limit all
foreach($site in $sites)
{
$spWeb = Get-SPWeb $site.url
$listTemplate = [Microsoft.sharepoint.SPListTemplateType]::DocumentLibrary
$spWeb.Lists.Add("Audits","Location for storage of Audit Files",$listTemplate)
}