SharePoint Online: How to Disable Quick Launch Bar using PowerShell?

Requirement: Hide Quick Launch Bar in SharePoint Online

How to Hide Quick Launch in SharePoint Online?
The Quick Launch or left navigation located in the left side of the site typically contains links to resources located in the current site like lists and libraries, subsites, etc. To turn off quick launch in SharePoint Online, Go to:
  • Site Settings >> Click on "Navigation Elements" under Look and Feel
  • Un-Check "Enable Quick Launch" and Click OK.
    sharepoint online disable quick launch bar
This removes quick launch in SharePoint Online. You can also hide quick launch in SharePoint Online from SharePoint Designer. Just open the site in SharePoint designer and Un-check "Display Quick Launch" under settings and save!

hide quick launch in sharepoint online using sharepoint designer

SharePoint Online: Disable Quick Launch using PowerShell:
#Load SharePoint CSOM Assemblies
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 Variable

#Setup Credentials to connect
$Cred = Get-Credential
Try {
    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
    #Disable Quick Launch
    $Ctx.Web.QuickLaunchEnabled = $False
    Write-host -f Green "Quick Launch Bar Disabled Successfully!"
Catch {
    write-host -f Red "Error:" $_.Exception.Message

Hide quick launch using PnP PowerShell:
#Config Variables
$SiteURL = ""

#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#Get the Web
$Web = Get-PnPWeb

#Disable Quick Launch
$web.QuickLaunchEnabled = $False
Here is another approach: Hide SharePoint Online Quick Launch using CSS

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.