0

I hadn't opted out, I don't know how I missed the message about opting out but today all of our lists/libraries have switched over to modern.

I can no longer switch it back to classic in the admin center, and having to do it at the individual list/library level is going to be killer.

Is there any way that I can set all lists/libraries back to the classic experience using powershell?

I've been searching and looking but have found nothing. I found this article on here, but from the comments it looks like this does not work?

Disable modern experience for a site collection

1

Refer below code :

    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"


    $webUrl = 'Enteryoursiteurl'
    $username = Read-Host -Prompt "Enter User Name" 
    $password = Read-Host -Prompt "Password for $username" -AsSecureString

    [Microsoft.SharePoint.Client.ClientContext]$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
    $clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)

    $web = $clientContext.web
    $lists = $web.Lists
    $clientContext.load($lists)
    $clientContext.ExecuteQuery()

    foreach($list in $lists){

        # Set the list experience (0 = Auto, 1 = modern, 2 = classic)
        $list.ListExperienceOptions = 2
        $list.Update()
        $clientContext.ExecuteQuery()

    }
  • 1
    Thank you Rohit, I found almost this same one on TechNet. Appreciate the time and help. Cheers. :) – Mark Apolinar May 20 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.