How to hide the left app navigation bar in sharepoint using PowerShell ?

Khushboo Kumari 117 Reputation points
2023-10-24T06:30:18.6833333+00:00

Hi,

I want to hide the left app navigation bar in sharepoint site using PowerShell script . Can you please help me how to do that ? I have found that we can do that by using css , I want to do that using PowerShell scripts.

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-10-30T08:02:51.0166667+00:00

    HI@Khushboo Kumari

    I hide the app bar on the homepage through spfx extension.

    Regarding how to generate spfx extension code, you can refer to the detailed process provided by the official:https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/build-a-hello-world-extension, and then just modify these few places, and then finally deploy the extension on the site (the official also provides the process of how to deploy:https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/serving-your-extension-from-sharepoint)

    User's image

    User's image

    Here is test :User's image

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng

    Was this answer helpful?


  2. Anonymous
    2023-10-24T09:05:52.7466667+00:00

    HI@Khushboo Kumari

    I found a tutorial:

    Here is link for your reference:

    https://ganeshsanapblogs.wordpress.com/2021/02/24/introducing-a-sharepoint-app-bar-that-features-global-navigation/

    You cannot disable the SharePoint app bar permanently.

    However, you can temporarily disable the SharePoint app bar in your tenant using PowerShell until March 31, 2022.

    Follow below steps to disable SharePoint app bar:

    1.Download the latest version of SharePoint Online PowerShell.

    https://docs.microsoft.com/powershell/sharepoint/sharepoint-online/connect-sharepoint-online

    2.Connect to SharePoint admin tenant site using:

    Connect-SPOService -Url https://<tenant>-admin.sharepoint.com

    3.Then, run the following command with administrator privileges:

    Set-SPOTemporarilyDisableAppBar $true

    Reference: Introducing a SharePoint app bar that features global navigation

    Here is my test:

    I discovered that this feature has been disabledUser's image

    User's image

    Alternate solution:

    Inject custom CSS using SPFx application customizer to hide the SharePoint app bar. You can use the CSS like:

    div#sp-appBar {
    display: none !important;
    }
    

    Note: DOM manipulation & CSS customizations are not recommended by Microsoft and some of your customization may break if Microsoft changes HTML element id/classes in new release updates.

    Here is link for your reference:

    https://sharepoint.stackexchange.com/questions/300794/how-to-disable-app-bar-on-sharepoint-online-modern-site#:~:text=Follow%20below%20steps%20to%20disable%20SharePoint%20app%20bar%3A,the%20following%20command%20with%20administrator%20privileges%3A%20Set-SPOTemporarilyDisableAppBar%20%24true

    ***If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.