Requirement: Hide a list or library from SharePoint Online site.
SharePoint Online: Hide Document Library using PowerShell
There are many ways to hide a SharePoint online list. Here is the PowerShell CSOM script to create hidden lists in SharePoint online.
Tags: sharepoint online hidden list, sharepoint online hide task list, sharepoint online create hidden list, sharepoint online hide document library, sharepoint online hide library
SharePoint Online: Hide Document Library using PowerShell
There are many ways to hide a SharePoint online list. Here is the PowerShell CSOM script to create hidden lists in SharePoint online.
#Load SharePoint CSOM AssembliesYou can also use SharePoint designer to mark a list hidden from browser. Read more here: How to hide a list in SharePoint?
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
#Config Parameters
$SiteURL= "https://crescent.sharepoint.com/sites/sales/"
$LibraryName="ProjectConfig"
#Setup Credentials to connect
$Cred = Get-Credential
$Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
Try {
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Cred
#Get the web and Library
$Web=$Ctx.Web
$List=$web.Lists.GetByTitle($LibraryName)
#Hide the list
$List.Hidden = $True
$List.Update()
$Ctx.ExecuteQuery()
Write-host -f Green "List hidden Successfully!"
}
Catch {
write-host -f Red "Error hiding List: " $_.Exception.Message
}
Tags: sharepoint online hidden list, sharepoint online hide task list, sharepoint online create hidden list, sharepoint online hide document library, sharepoint online hide library