Thursday, November 17, 2011

How to Hide a List using PowerShell

Last week i had a requirement to hide a list from user view. To achieve that, I used PowerShell to hide a list in SharePoint 2010 by setting hidden property of SPList Object to $true.

Here is the script -

#--- Update these variables -----
$SiteUrl = "http://Sharepoint2010/site"
$ListURL = "http://Sharepoint2010/site/Lists/ListToHide"
#-------------------------------------


$Web = Get-SPWeb $SiteUrl
$List = $spWeb.GetList($ListURL)
$List.Hidden = $true
$List.Update()

No comments:

Post a Comment