SharePoint Online: PowerShell to Disable Modern Experience

Requirement: Disable modern experience in SharePoint Online.

How to Disable New User Experience in a List and Switch back to Classic View?
Definitely the modern experience in SharePoint Online lists and libraries is faster, mobile friendly and easier to use. It brings new functionalities and components, such as: Quick edit metadata with information pane, Pin-Filter, Copy-Move, Custom Views, Column Formatting, Folder upload, etc. However, some features can only be used in the classic experience. So, you may need to disable modern experience in SharePoint Online at times.

To disable modern experience in SharePoint Online, Navigate to the list or library and then use the link "Return to Classic SharePoint" in the bottom left corner.
This sets all lists and libraries to use classic experience.

Disable Modern Experience at List Level:
You can switch between classic and new experiences in SharePoint Online by simply changing the below list settings.
  • Go to List or Library settings >> Click on "Advanced Settings"
  • Scroll down to the bottom, and from "List experience" section, Select "Classic Experience" option and Click OK.sharepoint online powershell disable modern experience
  • This changes the list UI back to classic experience in SharePoint Online:
    SharePoint Online Set List to Modern Experience
Update: The tenant level settings for lists and library experience in SharePoint Online Admin Center is no longer possible!

PowerShell to Disable Modern Experience in a List
#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"
#Variables for Processing
$SiteUrl = ""
$ListName= "Documents"

#Get Credentials to connect
$Cred = Get-Credential
Try { 
    #Set up the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl) 
    $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
    #PowerShell to disable modern experience in SharePoint Online
    $List = $Ctx.web.Lists.GetByTitle($ListName)
    $List.ListExperienceOptions = "ClassicExperience"
    Write-host "Modern Experience has been Disabled for the list!" -ForegroundColor Green        
catch {
    write-host "Error: $($_.Exception.Message)" -Foregroundcolor Red
How to Disabling New experience at Site Collection Level?
To turn-off modern experience at site collection, follow these steps:
  • Click on Settings Gear >> Site Information >> View All Site Settings >> Site Collection Features.
  • Scroll down and find "SharePoint Lists and Libraries experience" and activate.
    disable new experience in sharepoint online
This will turn-off modern experience from all lists and libraries at site collection level, Provided the list experience is set to "Default experience for the site"

Disable Modern Experience at Site Collection using PnP PowerShell
#Config Variables
$SiteURL = ""
#Connect PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#Disable Modern Experience at Site Collection level by activating Classic Exp Feature
Enable-PnPFeature -Identity "E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"  -Scope Site
Similarly, If you need to disable new experience at web level, use:
Enable-PnPFeature -Identity "52E14B6F-B1BB-4969-B89B-C4FAA56745EF" -Scope Web

If you need to enable or disable modern experience for a site or site collection using PowerShell CSOM script, use: SharePoint Online: Set List UI to Modern Experience or Classic Experience using PowerShell

1 comment:

  1. Thanks Pal. Your blog is quite precise and informative.


Please Login and comment to get your questions answered!

Powered by Blogger.