GitHub Icon Image
GitHub

Enable and Disable App Bar in SharePoint Online

Summary

This script sample demonstrates how to enable and disable the App Bar on SharePoint online sites by utilizing PnP PowerShell and SPO Management Shell.

Example Screenshot

Note

You cannot disable the SharePoint app bar permanently. However, you can temporarily disable the SharePoint app bar in your tenant using below PowerShell scripts until March 31, 2023.

  • PnP PowerShell
  • SPO Management Shell

# SharePoint online admin center URL
$siteUrl = "https://contoso-admin.sharepoint.com/"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $siteUrl -Interactive

# Set Temporarily Disable App Bar to True in order to disable
Set-PnPTemporarilyDisableAppBar $true

# Set Temporarily Disable App Bar to False in order to enable
Set-PnPTemporarilyDisableAppBar $false

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell

The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?


# SharePoint online admin center URL
$siteUrl = "https://contoso-admin.sharepoint.com/"

# Connect to SharePoint online admin center
Connect-SPOService -Url $siteUrl

# Set Temporarily Disable App Bar to True in order to disable
Set-SPOTemporarilyDisableAppBar $true

# Set Temporarily Disable App Bar to False in order to enable
Set-SPOTemporarilyDisableAppBar $false

# Disconnect SharePoint online connection
Disconnect-SPOService

Check out the SPO Management Shell to learn more at: Introduction SharePoint Online Management Shell | Microsoft Docs

Contributors

Author
Aman Panjwani
Ganesh Sanap

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Back to top Script Samples
Generated by DocFX with Material UI