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.

sharepoint online powershell disable modern experience in list

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 the “List experience” section, select the “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 = "https://crescent.sharepoint.com/sites/marketing/2018"
$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"
    $List.Update() 
    $Ctx.ExecuteQuery()
 
    Write-host "Modern Experience has been Disabled for the list!" -ForegroundColor Green        
}
catch {
    write-host "Error: $($_.Exception.Message)" -Foregroundcolor Red
} 

How to disable 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 = "https://crescent.sharepoint.com/sites/marketing"
 
#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

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “SharePoint Online: PowerShell to Disable Modern Experience

  • May 28, 2020 at 2:10 PM

    Thanks Pal. Your blog is quite precise and informative.

    Reply

Leave a Reply